Topic "upload from multiple local directory to 1 remote directory"

Author Message
alexanderlim
[View user's profile]

Joined: 2011-02-28
Posts: 1
Location: 134
Hi all,

I am not sure whether this is possible to do. I would like to upload only picture files from multiple local direcotyr into 1 remote directory. For example:

on local, I have:
c:\mypicture\2001\
c:\mypicture\2002\
c:\mypicture\2003\
c:\mypicture\2004\

Inside 2001, 2002, 2003, 2004 I have all my picture files.

I want to upload all those picture files into 1 remote directory. I have created a ftp login account that will login to the remote directory that I want to upload those picture files to.

So far this is what I have but it does not seems to work.

"C:\Program Files\WinSCP\WinSCP.exe" /script="C:\ftp_auto.txt"

ftp_auto.txt:

open test
option batch on
option confirm off
option include *.bmp;*.jpg;*.gif;*.png
synchronize remote "c:\mypicture\*\" "/"
exit

After upload, the remote directory should have:
picture1.jpg
picture2.jpg
picture3.jpg
picture4.jpg

No subdirectories under this directory should be created. Meaning that I do not want to have:
2001\picture1.jpg
2001\picture2.jpg
2002\picture3.jpg
2002\picture4.jpg

If inside directory 2001 and 2002 contain files with the same name, then only the latest one should be copied to the remote directory.

Any help would be greatly appreciated.

Thanks.

Regards,
AL
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You cannot do this with just WinSCP script. You have to create script in some scripting language that creates WinSCP script to do the task.
_________________
Martin Prikryl
Guest




prikryl wrote:
You cannot do this with just WinSCP script. You have to create script in some scripting language that creates WinSCP script to do the task.


Do you mean write a script that will recursively loop through every picture subdirectories and then upload each file?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Anonymous wrote:
Do you mean write a script that will recursively loop through every picture subdirectories and then upload each file?

Something like that. You do not need to upload every file separately, just every directory.
_________________
Martin Prikryl
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License