Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Problems with clearing files from input type="file"

  • No replies
  • 5 have this problem
  • 11 views
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)''

Modified by TonyE