I use WinSCP to transfer files to a protected SFTP server using the following script:
# Automatically answer all prompts negatively not to stall # the script on errors option batch on # Disable overwrite confirmations that conflict with the previous option confirm off # Connect using a password # open user:email@example.com # Connect open xxxxxxxx:firstname.lastname@example.org:xxxx-hostkey="ssh-dss 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx" # Change remote directory # cd /tmp/SFTP # Force binary mode transfer option transfer binary # Upload the file to current working directory put c:\Files\*.* # Disconnect close # Exit WinSCP exit
I receive the following error in the log file:
* 2009-10-20 08:00:02.206 Error code: 4 * 2009-10-20 08:00:02.206 Error message from server (en): Failure * 2009-10-20 08:00:02.206 Request code: 18 . 2009-10-20 08:00:02.206 Asking user: . 2009-10-20 08:00:02.206 Transfer was succesfully finished, but temporary transfer file 'CAMDEF_20091019.csv.filepart' could not be renamed to target file name 'CAMDEF_20091019.csv'. If the problem persists, you may try to turn off transfer resume support. ("General failure (server should provide error description).
When using the WinSCP GUI, I overcome the problem by disabling the Enable transfer resume/transfer to temporary filename for in Endurance
My question is : how can I disable the resume/temporary filename option in scripts when using scripts?
My config is:
WinSCP 4.1.8 (Build 415)
Windows XP Pro SP3
Thanks for your help and congratulations for such a useful piece of software :D