How can I know when a client loaded FTP file is complete?

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

I have a vb.net app that is using FileSystemWatcher to fire an event
when a file is uploaded by the client via FTP. The app needs to wait
until the upload is complete then perform actions on the uploaded file.
When I use file.exists, it returns true even before the file is
complete.
The file attribute (size) = (the completed file size); and attribute
(normal) = (normal) even before the file upload is complete.
I would greatly appreciate any suggestions for this.
 
josh,

my initial thought would be to try and rename the file, then read the file.
If the file upload is still in progress, you will get an exception on the
rename. Then sleep and try again later. I don't know of a fancier, api way
to tell if the file is busy.

jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top