Auto-Transfer Files Every Minute Using a Persistent FTP Connection

Advertisement

jgobert
Joined:
Posts:
1
Location:
Louisiana

Auto-Transfer Files Every Minute Using a Persistent FTP Connection

Hi,
I have a situation where I need to keep a persistent FTP session open to a remote server. Using that connection I need to have WinSCP auto-upload any PDF files found in a local directory to the FTP server. The connection has to be persistent because of the FTP server we're sending to. We have no control over that server and apparently it caches connections and blocks a sending server after three sessions have been opened. You would think that the remote server would drop a connection once the sending side completes it's task and disconnects but for some reason it does not. Therefore I need some option for keeping a connection open.

NOTE: I need the PDF files to be *MOVED* meaning they need to be deleted once successfully transferred.

Any thoughts?

Thanks in advance for your help!

JGobert

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,710
Location:
Prague, Czechia

Re: Auto-Transfer Files Every Minute Using a Persistent FTP Connection

You cannot implement a loop easily in a simple WinSCP scripting.

But you can use WinSCP .NET assembly from your favorite scripting language.
For example from PowerShell: https://winscp.net/eng/docs/library_powershell

We have examples for upload, which you can modify according to your needs:
https://winscp.net/eng/docs/faq_script_modified_files#last_timestamp
https://winscp.net/eng/docs/library_example_watch_for_changes

Reply with quote

Advertisement

You can post new topics in this forum