File upload in PHP _ PHP Tutorial

Source: Internet
Author: User
An issue with file upload in PHP. I have been confused. In this document, the description is vague, that is, the move_uploaded_file function, which adds a step-by-step check to check whether the file has been uploaded by HTTPPOST. As for this, I am still confused. In this document, the description is vague, that is, the move_uploaded_file function, which adds a step-by-step check to check whether the file has been uploaded through http post,


As for how to check.


I haven't been able to solve this problem after google for a while, and I don't know where it is. Later, I finally decided to read the source code. Finally, the file name and


The upload_tmp_dir parameter in the php configuration is compared. 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 another case, you should note that if move_uploaded_file is configured as an inaccessible path, no matter how you handle it, move_uploaded_file will not be able to successfully move the file.

Bytes. In this document, the description is vague, that is, the move_uploaded_file function, which adds a step-by-step check to check whether the file has been uploaded through http post. as ,...

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.