HTML input Type=file File Select a summary of the form (i)

Source: Internet
Author: User
HTML input Type=file in the process of uploading files in onchange, encountered the same file two times the issue of invalid upload.

recently in the process of doing the project, encountered the same file upload time, two uploads did not effect, found the information, found the reason:

It is explained as follows:

Input[type=file] Use onchange to do, onchange listen to the value of input, only when the content changes to trigger the time, and value in the upload of the file is the content of the file is saved, You only need to empty the value of the current input in the callback for the successful upload:


   event.target.value=‘‘;

HTML input Type=file File Select a summary of the form (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.