Topic "Trouble downloading filename with spaces"

Author Message
omarrodriguezt
[View user's profile]

Joined: 2009-09-28
Posts: 2
Location: Dominican Republic
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 http://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.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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
omarrodriguezt
[View user's profile]

Joined: 2009-09-28
Posts: 2
Location: Dominican Republic
. 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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
This bug has been added to tracker.
_________________
Martin Prikryl
Bava

Guest


I still have the same issue if download filename with spaces. Is this issue fixed for 4.2.8 version of winscp.exe?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
pattyengr
[View user's profile]

Joined: 2012-06-22
Posts: 5
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
pattyengr wrote:
put FIle name with spaces

put "FIle name with spaces"
_________________
Martin Prikryl
ArawnSt

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License