Topic "Unable to upload file with directory path"

Author Message
[View user's profile]

Joined: 2013-12-10
Posts: 1
I want to launch winscp.exe when a new file is created to upload the file to a remote ftp. I want to do it through simple coomand line ("winscp.exe [mysession] /upload file1 [/defaults]") so I can open and close a Winscp instance everytime a file is created.

If the file is located locally at "E:\Main Folder\Subdirectory 1\Subdirectory 2\File.doc", I need it remotely at "\share\Backup\Subdirectory 1\Subdirectory 2\File.doc", that is, I need to also create the subdirectory tree at the remote folder.

I've been trying for hours with no success. Can anybody point me in the right direction?

Thank you.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
There's no simple command-line to do this. How would you tell WinSCP what part of a local file path should get reflected in the remote path. I.e. that the Main Folder should not be created, while Subdirectory 1 should.

The only way is to tell WinSCP to "upload" whole E:\Main Folder, but use file mask to exclude everything in the tree, except that one single file.

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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License