WinSCP Synchronization Feature in .NET Code

Advertisement

aleagloan
Joined:
Posts:
1
Location:
Kansas

WinSCP Synchronization Feature in .NET Code

I am new to WinSCP so I am not sure how the "synchronization" feature works. I have the need to do file retrieval from another company's FPT site using SFTP three times a day at a certain time. I would like to use the "synchronization" feature to watch for file changes instead of using a scheduler. However, I do not know if I need to install the WinSCP.exe on the application server and have it running in the background all the time for it too work.

I install WinSCP using a nuget package for my .NET code. I was able to download a file from a test FTP site from another company. In other words, the GetFiles() worked.

I would really appreciate if you can guide me through this. Thank you.
Description: This file only downloads a file or files from another FTP site.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,034
Location:
Prague, Czechia

Re: WinSCP Synchronization Feature in .NET Code

aleagloan wrote:

However, I do not know if I need to install the WinSCP.exe on the application server and have it running in the background all the time for it too work.
Yes, you will have to. There's no API in FTP/SFTP to get notified about the changes. You have to proactively poll the server for changes. See https://stackoverflow.com/q/1277239/850848

Here is a PowerShell example of such code:
https://winscp.net/eng/docs/library_example_keep_local_directory_up_to_date

Reply with quote

Advertisement

You can post new topics in this forum