开发者

stop/cancel file upload in html?

开发者 https://www.devze.com 2023-01-22 19:45 出处:网络
If i have a file upload and i click on something to cancel it, how do i stop the upload? I tried doing$(\'form\').remove() and it appears to continue uploading. Maybe i should put it开发者_Go百科 in a

If i have a file upload and i click on something to cancel it, how do i stop the upload? I tried doing $('form').remove() and it appears to continue uploading. Maybe i should put it开发者_Go百科 in an iframe and destroy the iframe? then i need to figure out how to reload it hmm.

Are there any known cross platform ways?

-edit- btw this must be done in pure html and js, no flash or silverlight.


Use Flash to upload the file, then you have a lot more control to include a progress bar and allow the client to cancel.

Here's a commonly used JS wrapper, but I don't know if this specific one has a cancel api:

http://code.google.com/p/swfupload/

0

精彩评论

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

关注公众号