确定当FTP上传文件已准备好使用FileSystemWatcher的处理 [英] Determine when an FTP uploaded file is ready for processing using FileSystemWatcher
问题描述
我希望用户能够通过FTP上传文件到我的网站(IIS 7.5)。一旦文件上传,那么我要处理使用FileSystemWatcher的文件。你怎么能确定何时该文件已完成上传到服务器?我不想处理它它完成整个上载之前。
I want users to be able to upload files via FTP to my site (IIS 7.5). Once the file is uploaded, then I want to process the file using FileSystemWatcher. How can you determine when the file has completed uploading to the server? I don't want to process it before it completes the entire upload.
推荐答案
实在是,你可以知道文件本身没有办法完成上传。它被上传部分的第一和购买完成,甚至有可能
There is really no inherent way that you can know the file has completed uploading. It is even possible that it is uploaded partially first and completed later.
您要么需要确定从该文件的内容,这是一个完整的文件,或使用一些其他标记。例如,一个空文件标志着完成,即用户先上传 file1.dat
,然后上传 file1.done
来发出信号 file1.dat
现在可以处理。
You either need to determine from the file contents that it is a complete file or use some other marker. For example an empty file signifying completion, i.e. user first uploads file1.dat
and then uploads file1.done
to signal that file1.dat
can now be processed.
这篇关于确定当FTP上传文件已准备好使用FileSystemWatcher的处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!