开发者

Multiple file upload with md5 check before upload

I am building a webpage for which I need a multi-file upload implementation that can hash a file before uploading it to the server.

The idea is that users can upload files that may or may not exist on the server already. To save bandwidth I want to hash the file before uploading it to the server, send the hash via POST, and only proceed with upload if the server responds that it does not have a file with this hash.

Are there any free Flash-based implementations (I suppose that JavaScript won't be able to load th开发者_如何学Goe file and hash it) that may work for me?


You can read files in Javascript, FileReader API in HTML5 will do the job for you.

Next, feed the base64 string into b64_md5() function provided by this library: http://pajhome.org.uk/crypt/md5/instructions.html

Note that it could be time consuming if the file is too big. You might also need WebWorkers to do the conculation background.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜