Php $ _ FILES file size

Source: Internet
Author: User
Php $ _ FILES: how can I use $ _ FILES to get the size of uploaded FILES? why can't I get the file size if it exceeds 2 MB?
It can be obtained when the value is smaller than 2 MB.
Is it related to the settings in php. ini?


Reply to discussion (solution)

Related to settings in php. ini

Maximum file upload limit: upload_max_filesize

Yes. change upload_max_filesize to 100 MB.

Change upload_max_filesize to 100 M

Beyond the size set by php. ini, not only does the $ _ FILES connection $ _ POST $ _ GET and so on all expire

Of course! You can set the file or check the error message to see why the uploaded file is invisible. we recommend that you run $ _ FILES and var_dump!

Maximum file upload limit: upload_max_filesize

Maximum file upload limit: upload_max_filesize


Set the maximum value of the uploaded file.

Check $ _ FILES ['error'] first. an error occurs if the value is not 0,
1. the file size exceeds the server limit.
2. the size of the file to be uploaded exceeds the browser limit.
3. only part of the file is uploaded.
4. the file to be uploaded is not found.
5. the temporary folder on the server is lost.
6. An error occurred while writing the file to the temporary folder.

The default value of upload_max_filesize is 2 Mb.

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.