Question Check if file transfer via FTP is finished

sisquo76

Active member
Joined
Dec 1, 2008
Messages
28
Location
Bosnia and Herzegovina
Programming Experience
3-5
Hi all,

I am using Filezilla Server to transfer files to a folder from which I need to move transferred file (when completed). The problem is that even if file transfer is in progress it is not locked (I am able to move file to different location).

I am thinking to wait some time and check the file size (or modified date/time), and if it is the same size (date/time) then try to move it.

Is there a better way to do it than that I explained?

Best regards,

Fedja
 
What's the code you're using to ftp the file? Are you doing it in .Net code or calling an external ftp program to do it?
 
What's the code you're using to ftp the file? Are you doing it in .Net code or calling an external ftp program to do it?

Hi, I am not doing it in .NET code, FTP server is stand alone. I'm just trying to find a proper way to check if file transfer is completed so my application can move it to different location since FTP server does not lock the file during file transfer.
 
Hi, I am not doing it in .NET code, FTP server is stand alone. I'm just trying to find a proper way to check if file transfer is completed so my application can move it to different location since FTP server does not lock the file during file transfer.
If your program isn't doing the ftp transfer then you'll want to use a FileSystemWatcher to know when a new file is ready in the folder on the server then it can move it to the other location.
 
If your program isn't doing the ftp transfer then you'll want to use a FileSystemWatcher to know when a new file is ready in the folder on the server then it can move it to the other location.

I don't think FileSystemWatcher can determine when file transfer via FTP is finished, but thank you for reply.
 
I don't think FileSystemWatcher can determine when file transfer via FTP is finished, but thank you for reply.
Have you tried it?
Last I knew Windows OS only triggers things like FileSystemWatchers when a file is actually ready to be used, unless the FTP server isn't using a temp folder to receive a file then copy it into the folder with the correct name once complete, a FileSystemWatcher should work perfectly for you. But you'll have to try it and play with it to find out.
 
Back
Top