More familiar to the ASP friend may know to upload files with ASP but not too simple, PHP is different, easier, see examples: Send.htm and get.php as follows:
<!--文件send.htm -->
<form ENCTYPE="multipart/form-data" ACTION="get.php" METHOD=post>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000">
Send this file: <INPUT NAME="userfile" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</form>
The following code receives the uploaded file
<?php
#文件get.php
if (rename($userfile,"dirupload.dat)") {
echo "成功!";
}
else {
echo "上传不成功!";
}
?>
Description
A temporary directory in the php.ini file Upload_tmp_dir used to describe the file placement of PHP uploads
Second, the upload file stored in the temporary directory if not moved or renamed, it will be deleted immediately
Third, upload the file directory to have write permission
Last suggestion: Do not let the user upload executable files, or the settings can not be implemented, we should know why.