Home > Backend Development > PHP Tutorial > javascript - Unable to obtain file information when uploading in php

javascript - Unable to obtain file information when uploading in php

WBOY
Release: 2016-09-11 11:34:17
Original
957 people have browsed it

I use ajax to upload files to Php. All files within the operating range of Php file size can be obtained. However, if I upload a 300M file, nothing can be obtained from the PHP side. The print return information is as follows:
array( 0) {}
No Properties

How can we obtain file information or judge the file size without modifying the upload size of various configuration files such as PHP and browsers? Because I can’t get the files here, let alone determine the file size, please give me some advice!

Reply content:

I use ajax to upload files to Php. All files within the operating range of Php file size can be obtained. However, if I upload a 300M file, nothing can be obtained from the PHP side. The print return information is as follows:
array( 0) {}
No Properties

How can we obtain file information or judge the file size without modifying the upload size of various configuration files such as PHP and browsers? Because I can’t get the files here, let alone determine the file size, please give me some advice!

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

<code>var file = document.getElementById(InputElementID);
var sieze = dom.files[0].size;</code>
Copy after login

Have the upload file size limits of webserver and php.ini changed?

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

I passed a hidden value to it. Once it is obtained, it means that the data in the Post is in compliance with the size. Otherwise, intercepting it is theoretically possible but not the best way. You are welcome to answer and add. The problem here is that some POST software can POST directly. File streaming data used to be very embarrassing

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template