A problem encountered when uploading php files (move_uploaded_file)

Source: Internet
Author: User
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.

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.