Last time I wrote how to upload a file, after the successful upload, there will be some problems.
When I open the uploaded file, but did not click Upload, then close the pop-up window, and then continue uploading the file just now. In order to meet the requirements of the product group, we generally will cover the style.
But there will be some problems. In that case, when I open it again, the content of the overlay style is empty.
In fact, just at the beginning is baffled, and finally think about it, it should be the file content is not empty cause.
Surf the internet to check out the various methods of emptying.
More commonly used is the external plus a form form, and then empty the form inside the contents of the form.
Like, I add a form tag to the input tag, id videoform
Our product requirements upload file is in a box inside.
So every time I open the box, I just need to clear the content.
Specific code
document.getElementById (' Videoform ') &&document.getelementbyid (' Videoform '). Reset ();
The second method is
The action after each commit succeeds.
document.getElementById ("). outerHTML = document.getElementById ("). outerHTML
The input type file empties the content after it is uploaded.