Topic "Automation"

Author Message
ryc

Guest


Every day we get files on ftp server with differenct names. I want to write script that will transfer file as soon as it is posted to ftp server to the other server. Files have specific names. So, depending on name, file should be transfered to corresponning directory on the other server. Is this possible using winscp script?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25014
Location: Prague, Czechia
This example may help you:
https://winscp.net/eng/docs/script_download_most_recent_file

With 5.x you can also use .NET assembly, for example from PowerShell:
https://winscp.net/eng/docs/library_session_getfiles#powershell
https://winscp.net/eng/docs/library_session_listdirectory#powershell
_________________
Martin Prikryl
ryc

Guest


I am able to transfer file depending on name on ftp server to local machine. Once file is transfered, I want to transfer file on ftp server to archive directory in ftp folder itself depending on file name.

How can I do this tnasfering file on ftp server to different folders depending on file name?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25014
Location: Prague, Czechia
ryc wrote:
I am able to transfer file depending on name on ftp server to local machine. Once file is transfered, I want to transfer file on ftp server to archive directory in ftp folder itself depending on file name.

How can I do this tnasfering file on ftp server to different folders depending on file name?

Yes, but it's not a trivial task. I would recommend you use the WinSCP .NET assembly
https://winscp.net/eng/docs/library

Or you can stick with scripting and XML logging. The example linked in previous topic is still the one to use as an example.
https://winscp.net/eng/docs/script_download_most_recent_file
_________________
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