In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to solve the problem that php cannot receive file. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Php can not receive file solutions: 1, find the php.ini configuration file; 2, configure "upload_max_filesize = 30m" content; 3, modify the post_max_size option.
This article operating environment: windows7 system, PHP7.1 version, Dell G3 computer.
Common reasons why php can't get $_ file
Today, there was a strange problem when uploading the for form. The form submission could not be obtained, even the ordinary fields could not be obtained. Because I uploaded the file, I went to see if the for form added the enctype= "multipart/form-data" attribute, and found that it had also been added.
Later, when I went to php.ini to open the file upload function, file_uploads=on found that it was also turned on. After a long time of meditation and debugging, it still didn't work. After thinking that another project I did was also uploading pictures, I could get the data, so I took a look at it and found that there was no difference in the code. It still didn't work here. After that, I went to php.ini to see if there was anything wrong with the configuration. I saw that upload_max_filesize = 2m (that is, the file upload size is 2m) because I uploaded more than 2m files, I changed upload_max_filesize = 2m to upload_max_filesize = 64m, restarted the server, and found that it still didn't work. Later, I thought about whether there was a limit when the form was submitted, and post_max_size=8M was found in the interesting php.ini. (it represents the maximum byte length of POST data, which defaults to 8m.) Change it to post_max_size=64M, restart the service, and find it's OK.
Summary:
The default file upload size in the php.ini configuration file is 2m, and the default upload_max_filesize = 2m, that is, the file upload size is 2m. If you want to upload more than 8m files, such as 30m, you must configure upload_max_filesize = 30m.
However, just setting upload_max_filesize = 30m still can not achieve file upload function, you must modify the post_max_size option in the php.ini configuration file, which represents the maximum byte length of POST data, which defaults to 8m, so set post_max_size=30M.
If the POST data exceeds the limit, $_ POST and $_ FILES will be empty. To upload a large file, you must set this option to be greater than or equal to the value of the upload_max_filesize command.
Thank you for reading! This is the end of this article on "how to solve the problem that php can not receive file". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.