It is impossible to clear upload file input box. The only standard thing u can use is a .reset() method of the form but it is not good. It will reset all other fields. File input box is READ ONLY, however there is a trick you can do.

The trick is basically to re-create the field from scratch.

Using a jQuery:


Standard Javascript:

document.getElementById("filefield_id").innerHTML = document.getElementById("filefield_id").innerHTML;

Dima Svirid

Software architect, JAVA, Spring, Hibernate, AngularJs, Backbone, MongoDB, Oracle. CTO and Co-Founder of

More Posts

Follow Me:

Tagged with: