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#fn2 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 *no luck


/command " option batch abort " " option confirm off " " open sitename " " get ""/folder/my text file.zip C:\tmp\*""" exit *no luck

Thank you in advance.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
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.

_________________
Martin Prikryl

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

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Trouble downloading filename with spaces

This bug has been added to tracker.
_________________
Martin Prikryl

Reply with quote

Bava
Guest

Issue still not fixed in 4.2.8 winscp.exe?

I still have the same issue if download filename with spaces. Is this issue fixed for 4.2.8 version of winscp.exe?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Issue still not fixed in 4.2.8 winscp.exe?

Bava wrote:

I still have the same issue if download filename with spaces. Is this issue fixed for 4.2.8 version of winscp.exe?
It is fixed.

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

pattyengr
Joined:
Posts:
5

Problem with Space

Hi I am using 5.0.7 version of winscp and when transfering 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

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: Problem with Space

pattyengr wrote:

put FIle name with spaces
put "FIle name with spaces"
_________________
Martin Prikryl

Reply with quote

ArawnSt
Guest

retrieving files that have a space at the beginning of name.

I'm using scripting with WinSCP version 5.1.5 [Build 3261] on several versions of Windows. Connecting to an SFTP site.

Script is:

option batch on
open Session_Name
get *.* -delete
exit
---------------------

Called from batch:

winscp.com /script=script.txt
-----------------------

This works for all files except ones beginning with a space. If I put the entire filename in "", it'll retrieve, but the filename is going to be different each time (it starts with the date). I've tried:
get *.*
get " *201*"
get " 201*"
get "/ 201*"
For these files I still get the error message "No such file or directory." and "Specified file path is invalid".
I've also tried drag and drop from the GUI, but I still get the error messages, and an empty folder will appear where I tried to drop the file.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,316
Location:
Prague, Czechia

Re: retrieving files that have a space at the beginning of name.

ArawnSt wrote:

This works for all files except ones beginning with a space. If I put the entire filename in "", it'll retrieve, but the filename is going to be different each time (it starts with the date). I've tried: ...
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. 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.

_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum