Why does the javascript-thinkphp file be uploaded after the onchange event is added to the input file in the?

Source: Internet
Author: User
Keywords Thinkphp php javascript file upload input tag

I use the HTML5 FileReader implementation of the image upload preview function, the preview function, the submission of the form is reported "No files are uploaded" error, solve.
In the absence of a preview function can be successfully uploaded!!

Reply content:

I use the HTML5 FileReader implementation of the image upload preview function, the preview function, the submission of the form is reported "No files are uploaded" error, solve.
In the absence of a preview function can be successfully uploaded!!

1-No one likes to read the source code.
2-Stickers are useless content, neither the form nor the submission of JS and no PHP-side receive processing
3-filereader is to provide a preview, use it and file can not upload a little relationship is not.

4- The biggest may be your form a few parameters , casually find a form upload file example to see, there is a very important attribute, I forgot how to write.
5-php End should print $_files (or $_file, forget), if there is a file is uploaded so that you can see, as for your last one of the reasons for guessing the wrong point of no use.

The form label addsenctype="multipart/form-data"

  • 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.