Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an application that runs on a windows server 2008 box. It watches a folder for files, when a file appears (ftp upload) the application tries to move it to another folder as a test to see if it is fully uploaded. The problem is that the file is not being locked by the FTP server and is able to be moved, this causes a failure as the file is only partially uploaded when it is moved. How can I stop access to the file during upload?

share|improve this question

I would have the upload process create a second file, filename.lck, that would exist during the upload and be deleted after the upload is completed. Your application could then check for the presence of the .lck file instead of the actual file.

share|improve this answer
Thanks, Unfortunately one of the applications used to upload files is third party, locked down, and not configurable in any way, so I can't get it to produce a lock file. I'm going to replace the IIS ftp server with filezilla, which does lock the files during upload. – ctv-user Apr 30 '12 at 15:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.