I need to watch a folder in our network and if any files get dropped in any time of the day I need to ftp to a different folder.
Is this a feasible approach? Are there some links that will take me in right direction?
I need to watch a folder in our network and if any files get dropped in any time of the day I need to ftp to a different folder.
Is this a feasible approach? Are there some links that will take me in right direction?
Use System.IO.FileSystemWatcher to watch the folder: Listens to the file system change notifications and raises events when a directory, or file in a directory, changes.
Use System.Net.FtpWebRequest to send the file through FTP.
The best bet might be the filewatcher component. It seems to work reasonable well over a network.
To watch the file system, the (aptly named) FileSystemWatcher is a useful option. There are many reports of unreliability however, so polling periodically is important.
See this question for a small "Polling vs FileSystemWatcher" debate.
As far as the FTP upload goes, as Alfred says, FtpWebRequest should do what you need.
FileSystemWatcher as mentioned by the others will work fine in most cases, but not on Novell network drives.