简体   繁体   English

FTP文件上传-如何确定文件已在服务器上完成

[英]FTP upload of files - how to determine file upload has been completed on the server

I need to write a utility in C#. 我需要用C#编写一个实用程序。 The utility has to invoke a web-service once a file has been uploaded via FTP. 通过FTP上传文件后,该实用程序必须调用Web服务。 The files are text files (so they dont have an end-of-file marker and they can be pretty big). 这些文件是文本文件(因此它们没有文件结束标记,并且它们可能很大)。

The ftp server is the built in ftp server within Windows. ftp服务器是Windows中的内置ftp服务器。

My question is: How do I determine whether the file upload has been completed? 我的问题是:如何确定文件上传是否已完成? (so that I can call the web-service and tell it about the file?) If I dont wait to find out the file has been uploaded, then I might end up notifying the web-service prematurely (especially for really large files) (这样我就可以调用Web服务并告诉它有关文件的信息吗?)如果我不等着发现文件已上传,那么我可能最终会过早地通知Web服务(尤其是对于非常大的文件)

Have your process upload the file to a temporary directory and execute a move command to the destination directory. 让您的进程将文件上传到临时目录,然后执行移动命令到目标目录。

This way you know any files in your destination directory are complete. 这样,您就知道目标目录中的所有文件都是完整的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM