Trouble downloading filename with spaces

Advertisement

omarrodriguezt
Joined:
Posts:
2
Location:
Dominican Republic

Trouble downloading filename with spaces

Thank you for this great sofware!!!

I had develop an script that works great, except if I try to download a filename with spaces.

Here is the command line:
/command " option batch abort " " option confirm off " " open sitename " " get /folder/my text file.zip C:\tmp\*" exit
After running the script I get following in console:
Error code: 2
Error message from server: No such file
Request code: 7
Using WinSCP 4.2.3 on Windows XP

I was reading https://winscp.net/eng/docs/commandline#syntax and I found:
winscp.exe /console /command "option batch on" "open ""session with space"""
And I tried:
/command " option batch abort " " option confirm off " " open sitename " " get ""/folder/my text file.zip"" C:\tmp\*" exit
/command " option batch abort " " option confirm off " " open sitename " " get ""/folder/my text file.zip C:\tmp\*""" exit
No luck with either. Thank you in advance.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,442
Location:
Prague, Czechia

Re: Trouble downloading filename with spaces

Please post a full log file showing the problem.

To generate log file, enable logging, log in to your server and do the operation and only the operation that causes the error. For posting extensive logs you may use pastebin or similar application. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

omarrodriguezt
Joined:
Posts:
2
Location:
Dominican Republic

reply

. 2009-09-28 14:12:12.185 Using SFTP protocol.
. 2009-09-28 14:12:12.185 Doing startup conversation with host.
> 2009-09-28 14:12:12.185 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 14:12:12.185 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 14:12:12.185 SFTP version 3 negotiated.
. 2009-09-28 14:12:12.185 We believe the server has signed timestamps bug
. 2009-09-28 14:12:12.185 We will use UTF-8 strings for status messages only
. 2009-09-28 14:12:12.185 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 14:12:12.185 Getting current directory name.
. 2009-09-28 14:12:12.185 Getting real path for '.'
> 2009-09-28 14:12:12.185 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 14:12:12.185 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 14:12:12.185 Real path is '/root'
. 2009-09-28 14:12:12.185 Startup conversation with host finished.
. 2009-09-28 14:12:12.201 Cached directory change via "/tmp/" to "/tmp".
. 2009-09-28 14:12:12.201 Getting current directory name.
. 2009-09-28 14:12:12.201 Listing file "texto".
> 2009-09-28 14:12:12.201 Type: SSH_FXP_LSTAT, Size: 19, Number: 263
< 2009-09-28 14:12:12.201 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 14:12:12.201 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 14:12:12.201 Closing connection.
. 2009-09-28 14:12:12.201 Sending special code: 12
. 2009-09-28 14:12:12.201 Sent EOF message
. 2009-09-28 12:36:15.046 Using SFTP protocol.
. 2009-09-28 12:36:15.046 Doing startup conversation with host.
> 2009-09-28 12:36:15.046 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 12:36:15.061 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 12:36:15.061 SFTP version 3 negotiated.
. 2009-09-28 12:36:15.061 We believe the server has signed timestamps bug
. 2009-09-28 12:36:15.061 We will use UTF-8 strings for status messages only
. 2009-09-28 12:36:15.061 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 12:36:15.061 Getting current directory name.
. 2009-09-28 12:36:15.061 Getting real path for '.'
> 2009-09-28 12:36:15.061 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 12:36:15.061 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 12:36:15.061 Real path is '/root'
. 2009-09-28 12:36:15.061 Startup conversation with host finished.
. 2009-09-28 12:36:15.061 Listing file "/tmp/texto".
> 2009-09-28 12:36:15.061 Type: SSH_FXP_LSTAT, Size: 19, Number: 263
< 2009-09-28 12:36:15.061 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 12:36:15.061 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 12:36:15.061 Closing connection.
. 2009-09-28 12:36:15.061 Sending special code: 12
. 2009-09-28 12:36:15.061 Sent EOF message
. 2009-09-28 12:36:51.264 Using SFTP protocol.
. 2009-09-28 12:36:51.264 Doing startup conversation with host.
> 2009-09-28 12:36:51.264 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 12:36:51.279 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 12:36:51.279 SFTP version 3 negotiated.
. 2009-09-28 12:36:51.279 We believe the server has signed timestamps bug
. 2009-09-28 12:36:51.279 We will use UTF-8 strings for status messages only
. 2009-09-28 12:36:51.279 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 12:36:51.279 Getting current directory name.
. 2009-09-28 12:36:51.279 Getting real path for '.'
> 2009-09-28 12:36:51.279 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 12:36:51.279 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 12:36:51.279 Real path is '/root'
. 2009-09-28 12:36:51.279 Startup conversation with host finished.
. 2009-09-28 12:36:51.279 Listing file "/tmp/texto".
> 2009-09-28 12:36:51.279 Type: SSH_FXP_LSTAT, Size: 19, Number: 263
< 2009-09-28 12:36:51.279 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 12:36:51.279 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 12:36:51.279 Closing connection.
. 2009-09-28 12:36:51.279 Sending special code: 12
. 2009-09-28 12:36:51.279 Sent EOF message
. 2009-09-28 12:37:00.420 Using SFTP protocol.
. 2009-09-28 12:37:00.420 Doing startup conversation with host.
> 2009-09-28 12:37:00.420 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 12:37:00.420 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 12:37:00.420 SFTP version 3 negotiated.
. 2009-09-28 12:37:00.420 We believe the server has signed timestamps bug
. 2009-09-28 12:37:00.420 We will use UTF-8 strings for status messages only
. 2009-09-28 12:37:00.420 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 12:37:00.435 Getting current directory name.
. 2009-09-28 12:37:00.435 Getting real path for '.'
> 2009-09-28 12:37:00.435 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 12:37:00.435 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 12:37:00.435 Real path is '/root'
. 2009-09-28 12:37:00.435 Startup conversation with host finished.
. 2009-09-28 12:37:00.435 Listing file "/tmp/texto".
> 2009-09-28 12:37:00.435 Type: SSH_FXP_LSTAT, Size: 19, Number: 263
< 2009-09-28 12:37:00.435 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 12:37:00.435 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 12:37:00.435 Closing connection.
. 2009-09-28 12:37:00.435 Sending special code: 12
. 2009-09-28 12:37:00.435 Sent EOF message
. 2009-09-28 12:37:06.076 Using SFTP protocol.
. 2009-09-28 12:37:06.076 Doing startup conversation with host.
> 2009-09-28 12:37:06.076 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 12:37:06.092 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 12:37:06.092 SFTP version 3 negotiated.
. 2009-09-28 12:37:06.092 We believe the server has signed timestamps bug
. 2009-09-28 12:37:06.092 We will use UTF-8 strings for status messages only
. 2009-09-28 12:37:06.092 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 12:37:06.092 Getting current directory name.
. 2009-09-28 12:37:06.092 Getting real path for '.'
> 2009-09-28 12:37:06.092 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 12:37:06.092 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 12:37:06.092 Real path is '/root'
. 2009-09-28 12:37:06.092 Startup conversation with host finished.
. 2009-09-28 12:37:06.092 Listing file "/tmp/texto".
> 2009-09-28 12:37:06.092 Type: SSH_FXP_LSTAT, Size: 19, Number: 263
< 2009-09-28 12:37:06.092 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 12:37:06.092 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 12:37:06.092 Closing connection.
. 2009-09-28 12:37:06.092 Sending special code: 12
. 2009-09-28 12:37:06.092 Sent EOF message
. 2009-09-28 12:37:16.420 -------------------------
. 2009-09-28 12:37:16.685 Using SFTP protocol.
. 2009-09-28 12:37:16.685 Doing startup conversation with host.
> 2009-09-28 12:37:16.685 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2009-09-28 12:37:16.701 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2009-09-28 12:37:16.701 SFTP version 3 negotiated.
. 2009-09-28 12:37:16.701 We believe the server has signed timestamps bug
. 2009-09-28 12:37:16.701 We will use UTF-8 strings for status messages only
. 2009-09-28 12:37:16.701 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2009-09-28 12:37:16.701 Getting current directory name.
. 2009-09-28 12:37:16.701 Getting real path for '.'
> 2009-09-28 12:37:16.701 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2009-09-28 12:37:16.701 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2009-09-28 12:37:16.701 Real path is '/root'
. 2009-09-28 12:37:16.701 Startup conversation with host finished.
. 2009-09-28 12:37:16.701 Listing file "'/tmp/texto".
> 2009-09-28 12:37:16.701 Type: SSH_FXP_LSTAT, Size: 26, Number: 263
< 2009-09-28 12:37:16.701 Type: SSH_FXP_STATUS, Size: 29, Number: 263
< 2009-09-28 12:37:16.701 Status/error code: 2, Message: 263, Server: No such file, Language:  
. 2009-09-28 12:37:16.701 Closing connection.
. 2009-09-28 12:37:16.701 Sending special code: 12
. 2009-09-28 12:37:16.701 Sent EOF message

Reply with quote

pattyengr
Joined:
Posts:
5

Problem with Space

Hi I am using 5.0.7 version of WinSCP and when transferring file using the below commands through command prompt I am not able to send files with spaces. Well I am able to send the same file if I replace space with underscore
option batch abort
option conusername,server name password
cd (remote path)
lcd (local path)
option transfer binary
put File name with spaces

Reply with quote

Advertisement

You can post new topics in this forum