1.upfile.php file
File upload 2.upload.php
//Get the current date information, And concatenate into a string
$datetime = getdate();
$time = implode("",$datetime);
//Construct file name
//$filename="uploadfiles/ ".$time." ".$upfile_name;
$filename="uploadfiles/".$upfile_name;
//Actually store the file on the server
$copymes = copy($upfile,$ filename);
if ($copymes) {
print("File uploaded successfully!
n");
print("File name: $upfile_name
n");
print("Uploaded file size: $upfile_size
n");
}
else print("File upload failed!
n");
if (($upfile_type=="image/gif")||($upfile_type=="image/pjpeg"))
{
//If it is a graphic file format, it will be displayed
echo "< ;p>
";
}
?>
3. Please create a directory uploadfiles in the directory where the above file is located
[The copyright of this article is jointly owned by the author and Aosuo.com. If you need to reprint, please indicate the author and source. 】
http://www.bkjia.com/PHPjc/316434.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/316434.htmlTechArticle1.upfile.php file html body title file upload/title form enctype=multipart/form-data action=upload .php method=post input type=file name=upfile size=10brbr input type=submit value='Up...