1
votes

I'm using WinSCP to synchronize a remote FTP directory to a local one, some files have leading space in their names, those files are not found for WinSCP with error

Error transferring file '/xml/ file.mask.some.file.xml.gz'
Copying files from remote side failed.
File not found

The command I'm using is:

C:\tools\winscp.com /command ^
    "option batch on" ^
    "option confirm off" ^
    "open ftp://user:password@server -certificate=""" ^
    "synchronize local ""D:\FTP\Data\PM"" ""/xml/"" -filemask=*file.mask.*.xml.gz>200D;" ^
    "exit"

How can I ignore this leading space when getting these files?

1
What do you mean by "ignoring this leading space"? What exactly do you want to do with those files?Martin Prikryl
I want to download them to the local location, I mean how to fix this error so that '/xml/ fileNameWithLeadingSpace.xml.gz' is downloaded successfullyElias Ghali
What version of WinSCP are you using?Martin Prikryl
Winscp version 5.9.1Elias Ghali
Please post a log file showing the problem (ideally, use the latest version of WinSCP).Martin Prikryl

1 Answers

0
votes

It looks like a server-side problem.

You are using FileZilla FTP server 0.9.41 beta (2012-02-26). That version did not allow working with files with leading/trailing whitespaces. This was fixed in 0.9.43 (2014-01-02).

Try updating your FileZilla FTP server to the latest version. I have no problem downloading a file with a leading space when using version 0.9.60.2.


You also need to have a recent version of WinSCP (5.8 and later), as old versions did not allow working with files with leading spaces either.