//多文件上载系统完整版 include("../include/common.inc"); $title = "多个文件的上载程序"; include("../include/header.inc"); //定义允许上载文件的数目 define("UPLOAD_NO", 10); echo("
欢迎您! 一次可以最多上载".UPLOAD_NO."个文件 n"); if($REQUEST_METHOD!="POST"){ echo(" 是否覆盖已经存在的文件? "); echo(" n"); } else{ //处理上载 $noinput = true; for($i=1;$noinput&&($iif(${"infile".$i}!="none") $noinput = false; } if($noinput){ echo("没有选定的文件,返回重试 "); exit(); } echo("
您选中的文件已经成功地上载到服务器的临时目录! "); echo("
文件号 文件名称 文件大小
"); for($i=1;$i$just=${"infile".$i."_size"}; $fp_size[i] = $just; if($overload!=ON){ if(file_exists(AddSlashes(dirname($PATH_TRANSLATED))."\upload\".${"infile".$i."_name"})) echo "您上载的文件".${"infile".$i."_name"}." 已经存在,该文件拷贝失败! "; else{ if(${"infile".$i}!="none"&©(${"infile".$i},AddSlashes(dirname($PATH_TRANSLATED))."/upload/".${"infile".$i."_name"})&&unlink(${"infile".$i})){ $str = ${"infile".$i."_name"}; echo(" $i $str $fp_size[i]
"); } } } else{ if(${"infile".$i}!="none"&©(${"infile".$i},AddSlashes(dirname($PATH_TRANSLATED))."upload".${"infile".$i."_name"})&&unlink(${"infile".$i})){ $str = ${"infile".$i."_name"}; echo(" $i $str $fp_size[i]
"); } } } echo "
";
}
include("../include/footer.inc");
?>
Statement: 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