搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

Learn More

Problems with clearing files from input type="file"

  • 无回复
  • 5 人有此问题
  • 5 次查看
more options

I'm using ‹input type="file".. to upload files in some javascript.

The page containing the ‹input type="file".. is not reloaded, so data on the ‹input type="file".. is not cleared.

I've done this with form.reset() in IE, which cleares files from ‹input type="file".., but this doesn't work in Firefox. The next time I try to submit a file two files are submitted.

I've even tried to replace the ‹input type="file".. to clear all data, but if i replace it with a ‹input type="file".. with same id, the files is still there from before.

So my question is, how do I clear files selected

(Edited to make the HTML code display properly -TonyE)

I'm using ‹input type="file".. to upload files in some javascript. The page containing the ‹input type="file".. is not reloaded, so data on the ‹input type="file".. is not cleared. I've done this with form.reset() in IE, which cleares files from ‹input type="file".., but this doesn't work in Firefox. The next time I try to submit a file two files are submitted. I've even tried to replace the ‹input type="file".. to clear all data, but if i replace it with a ‹input type="file".. with same id, the files is still there from before. So my question is, how do I clear files selected ''(Edited to make the HTML code display properly -TonyE)''

由TonyE于修改