Implementation of file upload
Friends who are familiar with ASP may know that uploading files with ASP is not easy. PHP is different and easier. See examples: send.htm and get.php as follows:
The following code receives the uploaded file
#File get.php
if (rename($userfile, "dirupload.dat)") {
echo "Successful!";
}
else {
echo "Upload failed!";
}
?>
Note:
1. The upload_tmp_dir in the php.ini file is used to describe the temporary directory where the files uploaded by PHP are placed.
2. If the uploaded files stored in the temporary directory have not been moved or renamed, then It will be deleted immediately
3. The directory where the files are uploaded must have write permissions
Final suggestion: Do not allow users to upload executable files, or set the settings to disable execution. Everyone should know why.
http://www.bkjia.com/PHPjc/315447.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315447.htmlTechArticleImplementation of file upload Friends who are familiar with ASP may know that uploading files with ASP is not easy. PHP is different. It's easier, look at the examples: send.htm and get.php as follows: !--File send...
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn