Comand MPUT -Delete how to

Advertisement

savoyard37
Joined:
Posts:
2
Location:
France

Comand MPUT -Delete how to

Hi support ,

We are trying to us the WinSCP scripting to copy files from local to FTP server.
It work fine but if add -delete, it delete files and local folder too.

script is here:
# Automatically abort script on errors
option batch abort
 
# Disable overwrite confirmations that conflict with the previous
option confirm off
 
# Logging Session
#/log=c:\QxxxFTP\logs-to-as.log
 
# Connect to FTP server using a password
open ftp://user:password@IPADRESS
 
# Download file
mput C:\QxxxuadientFTP\aims_depot\ -filemask=*.jaf /FromGMC
 
# Disconnect
close
 
# Exit WinSCP
exit
Thanks for assist.
LC

Reply with quote

Advertisement

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

Re: Comand MPUT -Delete how to

If you check the script output, it should say:
Selecting files using a path ending with slash is ambiguous. Remove the slash to select the folder. Append * mask to select all files in the folder.
And that's your problem.
See also https://winscp.net/eng/docs/scriptcommand_put#remarks
The correct syntax is:
put -delete C:\QxxxuadientFTP\aims_depot\* -filemask=*.jaf /FromGMC/
Or
put -delete C:\QxxxuadientFTP\aims_depot\*.jaf /FromGMC/
Note that I'm using put, as mput is just an alias.

Reply with quote

Advertisement

You can post new topics in this forum