FluentFTP
FluentFTP copied to clipboard
Should FTP work be done with temp files?
I apologize if this question is more of a StackOverflow question but maybe these things are already worked into FluentFTP.
So as I understand it FTP does not lock files when they are uploading or downloading.
So how do I implement a 'safe' set of usability APIs?
For upload should I upload to a temp file and then when upload is done rename the file to intended name? And for download how can I know if an upload is in progress? And also when downloading should I create a copy of the file and then download the copy?
So these operations are pretty fast for small files but may become more important when dealing with larger files and then having polling services that look file new files or file changes.
What are the best practices when exposing these kinds of functions?
These are application level concerns that should be handled on your end. We have no way of handling these things internally, nor do we have the scope for it.
I do agree with you. Was looking for best practice solutions but I can probably find those other places.
These are application level concerns that should be handled on your end.
+1
And if these concerns are of importance to you, you need to re-evaluate choosing FTP as your chosen file transfer protocol. Many of these concerns would need at least a "matched client-server pair". Most servers don't offer any of the needed functionality and it is not part of the FTP RFCs anyway - so it would be non-standard.
Yeah unfortunately we don't have a choice on protocol. We are adding support requested by customer. They need FTP support for monitoring files from a 3. party system that use FTP to transfer files.
And I still agree. FTP is not the best choice but currently the only choice available.
I guess we will do our implementation v1 and then work from there if errors occur.
Thanks.
Closing as we cannot really help out here.