Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
1k views
in FAQ: edtFTPnet/PRO by (450 points)
We have a client that we are uploading a file to. They have a system that moves files out of the folders. He is concerned that the file will be moved out of the folder before it is finished uploading. We are using the .NET version of the EDT Pro library.

My question is: When EnterpriseDT uploads a file, does it put a file lock on the file it is uploading, on the target server that it is uploading to? i.e. Could their system move the file before EDT is finished uploading the file?

1 Answer

+1 vote
by (162k points)
No, a file lock is not put on the file (unless the FTP server that actually doing the file write puts a lock on the file). There is no mechanism for the FTP client to do this. Typically, FTP servers don't lock this file as often another process may be reading it.  They may put a write lock but you can't count on it.

The usual approach is to upload to a temporary file name and then rename it to the target filename once the upload is complete. This should avoid the problem you are describing.
by (450 points)
That is good information to know. Thank you very much for the answer and the suggested approach to avoid issues.
...