Implementation of File Upload

Source: Internet
Author: User
Keywords Implementation of File Upload
Implementation of File Upload

More familiar with the ASP friend may know to upload files with ASP is not too simple, PHP is different, easier, see examples: Send.htm and get.php as follows:


   

The following code receives the uploaded file
#文件get. php
if (rename ($userfile, "\dir\upload.dat)") {
echo "Success!" ";
}
else {
echo "Upload not successful! ";
}
?>
 

Description
One, the php.ini file Upload_tmp_dir used to describe the PHP uploaded files placed in a temporary directory
Second, the upload file stored in the temporary directory if not moved or renamed, it will be deleted immediately
Third, the directory to upload files to have write permission
The final recommendation: Do not let users upload files that can be executed, or the settings can not be executed, you should know why
  • 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.