Home > Backend Development > PHP Tutorial > File transfer tool All source code of file upload program

File transfer tool All source code of file upload program

WBOY
Release: 2016-07-29 08:34:08
Original
1564 people have browsed it

1.upfile.php file


File upload









2.upload.php
//Get the current date information and connect it into a string
$datetime = getdate();
$time = implode("",$datetime);
//Construct the 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") ; T Print ("uploaded file size: $ upfile_size & lt; br & gt; n"); ")||($upfile_type=="image/pjpeg"))
{
//If it is a graphic file format, it will be displayed
echo "

";
}
?>
3. Please create a directory uploadfiles in the directory where the above file is located.
[The copyright of this article belongs to the author and O Co-owned by Suowang. If you need to reprint, please indicate the author and source]

The above introduces the entire source code of the file transfer tool file upload program, including the content of the file transfer tool. I hope it will be helpful to friends who are interested in PHP tutorials.


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template