JS to clear the <input type = "file"> select
As soon as the user selects the file, I have a condition using the html5 api file to check if the file size is larger than 1 Mb.
function handleLimit(evt) { var files = evt.target.files; f = files[0]; console.log(f.size); if (f.size > 1048576) { /*JS for clearing form*/ } } What would be the script that I would like to run in my input tag to clear / force the client to select another file when the handler knows that the file is larger than a certain size?
+4