开发者

How to read file asynchronously using javascript for fileupload

开发者 https://www.devze.com 2023-02-02 13:00 出处:网络
I need to read the file selected by the user for uploading it to server.And send the data read to server and store it there.I am trying to implement a file upload in which the user can pause the file

I need to read the file selected by the user for uploading it to server.And send the data read to server and store it there.I am trying to implement a file upload in which the user can pause the file upload and resume it later on. So for this i need to read the file from random positions. I found HTML-5 support this. But it is not supported in开发者_运维知识库 all Browser.. So any help ??

Thanks in advance..


you have to use a technology that bypasses the browser's security model. :-(

Javascript running in the browser has no access to the file system for security reasons and similarly has very limited access to the file upload form control. (for example, you wouldn't want a browser to be able to quietly upload files to a remote server)

A very popular open source project that lets you bypass the security model to some extent is SWF Upload. Unfortunately, out of the box, it does not allow you to do what you want, create resumable uploads. That means you're going to either have to hack at it (it's open source) or use a different technology that you're more comfortable with, such as Java or a browser extension.

EDIT:

A new jquery plugin was announced that will help you with exactly what you want. It's called plupload: http://plupload.com/

0

精彩评论

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

关注公众号