开发者

Ruby check if webdav upload is complete

I would like to offer an upload folder for our clients. As Windows, Linux and MacOS X have out of the box support for webdav, we chose an Apache server with the DAV module. This works nicely.

However, some postprocessing should be applied to some files and some of the files are > 50M. Some users have a 开发者_如何学Cslow internet connection so the upload sometimes takes more than 2 minutes. The postprocessing consists of a ruby script that iterates over new files in the document root of the webdav-enabled apache. The problem is, that I would like to find out which files have actually finished uploading, so I don't end up post processing half-uploaded files.

Is there a way?


While transferring a file to a Apache DAV server (tried with Mac OS X SLS and Apache), a temporary file named ._filename.ext is created in the same directory. When the upload is completed, the temporary file is removed.

So I guess you can just check against that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜