You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "min yun law (Jira)" <ji...@apache.org> on 2020/11/30 19:33:01 UTC

[jira] [Commented] (SSHD-1106) SCP failed for target filename with space inside

    [ https://issues.apache.org/jira/browse/SSHD-1106?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240990#comment-17240990 ] 

min yun law commented on SSHD-1106:
-----------------------------------

after give quotation to the remote file, it will works:



scpClient.upload(pathFile,
 /* Mina scp HAS bug for file that has space when it try to for scp
 command as
 "-p -f -- remotefilefullpath"
 we will pass the quotated path to it

*/
 "\"" + remoteFullPath + "\"",
 options);

> SCP failed for target filename with space inside
> ------------------------------------------------
>
>                 Key: SSHD-1106
>                 URL: https://issues.apache.org/jira/browse/SSHD-1106
>             Project: MINA SSHD
>          Issue Type: Bug
>    Affects Versions: 2.5.1
>            Reporter: min yun law
>            Priority: Major
>
> when using ScpClient.upload() and download() API and give the remote file name with space inside, it will throw exception as:
> java.io.EOFException: readAck - EOF before ACK
>  
> Here is sample of code:
> String localDir = "/scratch/downloads/";
>  String fileName = "p201300_Linux-x86-64 (1).zip";
>  String remotePath = "/tmp";
> File localPathFile = new File(localDir, fileName);
>  Path pathFile = localPathFile.toPath();
> //remote is linux 
> String remoteFullPath = remotePath+"/"+fileName;
> Collection<ScpClient.Option> options = EnumSet.noneOf(
>  ScpClient.Option.class);
> scpClient.upload(pathFile,remoteFullPath,option); //it will throw exception 
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@mina.apache.org
For additional commands, e-mail: dev-help@mina.apache.org