Topic "Put command - upload files within a folder but not the folder itself"

Author Message
SuperSS

Guest


Hello,

I'm trying to use the PUT command to upload the contents of a folder into the root folder of my ftp server, but not the folder itself. Basically I want the entire contents of the folder to go directly into the root folder of the FTP. This is what I tried to do:

/command "open ftp://user:pass@ftp server" "put C:\Users\Computer\Desktop\Upload\ /" "exit"

What am I missing?

Thank you.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26553
Location: Prague, Czechia
You are missing a star (a file mask):

/command "open ftp://user:pass@ftp server" "put C:\Users\Computer\Desktop\Upload\* /" "exit"

See https://winscp.net/eng/docs/scriptcommand_put#remarks

If you are using the latest version of WinSCP, you should actually get a hint about this in console output (and in the log):

Quote:
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.
Advertisements

You can post new topics in this forum






Search

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