File information cannot be obtained during javascript-php Upload.

Source: Internet
Author: User
I use ajax to upload files to Php. all files within the range of Php file size can be obtained, however, if the file I uploaded is mb, php won't get anything. print the returned information as follows: array (0) {} NoProperties does not use php, browsers, and other modifications... I use ajax to upload files to Php. all files within the range of Php file size can be obtained, however, if the file I uploaded is a M file, php won't get anything. print the returned information as follows:
Array (0 ){}
No Properties

Without modifying the size of configuration files such as php and browsers, how can I obtain the file information or determine the file size? This is because the file cannot be obtained, let alone the file size. please give me some advice!

Reply content:

I use ajax to upload files to Php. all files within the range of Php file size can be obtained, however, if the file I uploaded is a M file, php won't get anything. print the returned information as follows:
Array (0 ){}
No Properties

Without modifying the size of configuration files such as php and browsers, how can I obtain the file information or determine the file size? This is because the file cannot be obtained, let alone the file size. please give me some advice!

It seems that you can use js to check the file size

var file = document.getElementById(InputElementID);var sieze = dom.files[0].size;

Has the size limit of files uploaded by webserver and php. ini been changed?

It should be that php has enough running time, but the file is not uploaded successfully, so there is no file information at all.

I passed a hidden value in the past. if it is obtained, it indicates that the data in the Post object is consistent with the size. Otherwise, it will be blocked. Theoretically, this is acceptable, but it is not the best solution. You are welcome to answer this question, the problem here is that some POST software can directly POST the file stream data. this is very embarrassing.

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.