Home > php教程 > php手册 > 实现文件上传的程序源码

实现文件上传的程序源码

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:35:36
Original
885 people have browsed it



文件上传界面



if($UploadAction){
$UploadAction=0;
$TimeLimit=60;
/*设置超时限制时间默认时间为 30s,设置为0时为不限时 */
set_time_limit($TimeLimit);
If(($Upfile != "none")&&
($Upfile != ""))
{
$Filepath="d:webwebphp est"; //上载文件存放路径
$FileName=$Filepath.$Upfile_name;
if($Upfile_size {$FileSize = (string)$Upfile_size . "字节";}
elseif($Upfile_size {
$FileSize = number_format((double)($Upfile_size / 1024), 1) . " KB";
}
else
{
$FileSize = number_format((double)($Upfile_size/(1024*1024)),1)."MB";
}
if(!file_exists($FileName))
{
if(copy($Upfile,$FileName))
{unlink($Upfile);
echo "

";
echo "文件 $Upfile_name 已上载成功!";
echo "

";
echo "文件位置:$FileName";
echo "

";
echo "文件大小:$FileSize";
echo "

";
}
else
{echo "文件 $Upfile_name上载失败!"; }
}
else
{echo "文件 $Upfile_name已经存在!"; }
}
else
{echo "你没有选择任何文件上载!"; }
set_time_limit(30); //恢复默认超时设置
}
?>
ACTION = "default.php" METHOD = "POST">







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
Latest Issues
ubuntu mongodb 出现 exception: connect failed
From 1970-01-01 08:00:00
0
0
0
An error occurred
From 1970-01-01 08:00:00
0
0
0
Why does clicking login jump to hello world?
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template