The number of uploaded files cannot be calculated.

Source: Internet
Author: User
You cannot calculate the number of uploaded files. you just copied a section of JAVASCRIPT that adds a text box node, but now you can press "add another" to add a new & lt; input & nbsp; text = "file" & nbsp; name = "img []" & gt; I added & nbsp; echo & nbsp; to the submitted code of the node; 'co cannot calculate the number of uploaded files
Just copied a section of JAVASCRIPT that adds a text box node.
However, if you press "add another" to add a new Node
I added echo 'count ($ _ FILES ['IMG '] ['name'])' to the submitted code) ';

I added two files and printed them out. Why didn't I calculate them? Share to: I am submitting a node... 'data-pics = ''>
------ Solution --------------------
If the value is 1, we recommend that you paste the code for analysis.
------ Solution --------------------
Print $ _ FILES first!
------ Solution --------------------
This is your initial control


This is the control you attached.
Input. setAttribute ('name', 'files [] '); // Set the name attribute of the input node to files [] and pass it to the server as an array.

This is the control you are processing.
$ Num = count ($ _ FILES ['IMG '] ['name']); // calculates the number of uploaded FILES

Should it be clear? Be careful

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.