1. upfile. php file upload 2. upload. php3. create a directory named uploadfiles in the directory where the above file is located. [the copyright of this article is shared by the author and osuo. if you need to reprint it, please indicate the author and its source.] SyntaxHighlighter. all ();
1. upfile. php file
File Upload
2. upload. php
// Obtain the current date and connect it to a string
$ Datetime = getdate ();
$ Time = implode ("", $ datetime );
// Construct the file name
// $ Filename = "PreviousFiles/". $ time. "". $ upfile_name;
$ Filename = "previusfiles/". $ upfile_name;
// Stores the file on the server.
$ Copymes = copy ($ upfile, $ filename );
If ($ copymes ){
Print ("file uploaded successfully!
N ");
Print ("File name: $ upfile_name
N ");
Print ("size of the uploaded File: $ upfile_size
N ");
}
Else print ("file Upload failed!
N ");
If ($ upfile_type = "image/gif") | ($ upfile_type = "image/pjpeg "))
{
// Display the image file format
Echo"
Echo $ filename;
Echo "height = 150 width = 150 align = center border = 0> ";
}
?>
3. create a directory named previusfiles in the directory where the above file is located.
[This article is copyrighted by the author and osuo. if you need to reprint it, please indicate the author and its source]