如何取消文件上传? [英] How to cancel a file upload?
本文介绍了如何取消文件上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何使用 multipart / form-data
格式取消文件上传。这是可能的吗?
I want to know how I can cancel a file upload with a form multipart/form-data
. Is that possible?
推荐答案
使表单发布到隐藏的 iframe
。当您要取消时,更改 iframe
src
。浏览器将重新加载 iframe
,并取消上一个 POST
请求。
Make the form post to a hidden iframe
. Change the iframe
src
when you want to cancel. The browser will reload the iframe
and cancel the previous POST
request on it.
这篇关于如何取消文件上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文