A problem encountered when uploading php files (move_uploaded_file)
| When uploading a php file, you cannot use the move_uploaded_file function to move the file, but you can use copy or rename. When uploading a php file, you cannot use the move_uploaded_file function to move the file, but you can use copy or rename. The fuzzy description in this document refers to the move_uploaded_file function, which adds a step-by-step check to check whether the file has been uploaded through http post. Later, the source code shows that the file name is compared with the upload_tmp_dir parameter in the php configuration. if the file is under this directory, move_uploaded_file will be moved. In addition, the comparison is case sensitive, and/\ is also different in Windows. When parsing the PHP configuration file, a realpath function is called, that is, before move_uploaded_file, for $ file ['tmp _ name'] = realpath ($ file ['tmp _ name']); realpath. In addition, note that if move_uploaded_file is configured as an inaccessible path, no matter how it is processed, move_uploaded_file cannot be successfully moved. |