This article mainly shares with you how to solve the problem when the PHP form $_FILES is empty. There are many situations where $_FILES cannot receive the value during file upload. To summarize, the common mistakes are as follows, which are also easy for everyone to make during use. mistake.
1. Forgot to add the enctype="multipart/form-data" attribute in the form, this is the most common mistake;
2. Forgot to turn on the file upload function file_uploads=on## in php.ini
<form action="" method="post" enctype="multipart/form-data"> ...... </form>
Description | |
---|---|
Encode all characters before sending (default) | |
Do not encode characters . This value must be used when using a form that contains a file upload control. | |
Spaces are converted to "+" plus signs, but special characters are not encoded. |
This parameter is in the PHP configuration file php.ini.
Related recommendations:
Details of the $_FILES function in PHPHow to use $_FILES in phpphp file upload-configure php.ini file and predefined variables $_FILESThe above is the detailed content of How to solve the problem that PHP form $_FILES is empty. For more information, please follow other related articles on the PHP Chinese website!