最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

多文件上载系统完整版

来源:懂视网 责编:小采 时间:2020-11-27 19:01:15
文档

多文件上载系统完整版

多文件上载系统完整版:<php //多文件上载系统完整版 //功能强大,可任意控制上载文件数,是否覆盖 include("../include/common.inc"); $title = "多个文件的上载程序"; include("../include/header.inc")
推荐度:
导读多文件上载系统完整版:<php //多文件上载系统完整版 //功能强大,可任意控制上载文件数,是否覆盖 include("../include/common.inc"); $title = "多个文件的上载程序"; include("../include/header.inc")

<?php
//多文件上载系统完整版
//功能强大,可任意控制上载文件数,是否覆盖

include("../include/common.inc");
$title = "多个文件的上载程序";
include("../include/header.inc");

//定义允许上载文件的数目

define("UPLOAD_NO", 10);

echo("<p align='center'><font size='4' color='#000080'>欢迎您!<br>一次可以最多上载".UPLOAD_NO."个文件<br><HR>n");
if($REQUEST_METHOD!="POST"){
    echo("<form enctype="multipart/form-data" method=post>n");
    echo("<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="3000000">n");

    for($i=1;$i<=UPLOAD_NO;$i++){
        echo("<input type=file name=infile$i>   ");

        if($i%2==0)
        echo("<br>n");
    }

    echo("<br><br><input type="checkbox" name="overload" value="ON"></font> <font color='#ff0000'>是否覆盖已经存在的文件?</font>");
    echo("<br><br><input type=submit value=上载></form>n");
}
else{
    //处理上载
    $noinput = true;
    for($i=1;$noinput&&($i<=UPLOAD_NO);$i++){
         if(${"infile".$i}!="none") $noinput = false;
    }
    if($noinput){
        echo("<font size='4' color='#000080'>没有选定的文件,返回重试</font>");
        exit();
    }
    echo("<p align='center'><font size='4' color='#000080'>您选中的文件已经成功地上载到服务器的临时目录!</font><br>");         
    echo("<table border='1' width='84%' height='52' bordercolorlight='#008080' bordercolordark='#008080'>
        <tr>
            <td width='14%' bgcolor='#008000' height='21'><font color='#FFFFFF'>文件号</font></td>
            <td width='52%' bgcolor='#008000' height='21'><font color='#FFFFFF'>文件名称</font></td>
            <td width='34%' bgcolor='#008000' height='21'><font color='#FFFFFF'>文件大小</font></td>
        </tr>");

    for($i=1;$i<=UPLOAD_NO;$i++){
        $just=${"infile".$i."_size"};
        $fp_size[i] = $just;

        if($overload!=ON){
            if(file_exists(AddSlashes(dirname($PATH_TRANSLATED))."\upload\".${"infile".$i."_name"}))
                echo "<font size='4' color='#ff0000'>您上载的文件<font color='#000000'>".${"infile".$i."_name"}."</font>已经存在,该文件拷贝失败!</font><br>";
            else{
                if(${"infile".$i}!="none"&©(${"infile".$i},AddSlashes(dirname($PATH_TRANSLATED))."/upload/".${"infile".$i."_name"})&&unlink(${"infile".$i})){
                $str = ${"infile".$i."_name"};
                echo("<tr>
                    <td width='14%' height='19'>$i</td>
                    <td width='52%' height='19'>$str</td>
                    <td width='34%' height='19'>$fp_size[i]</td>
                    </tr>");
                  }
            }
        }
        else{
            if(${"infile".$i}!="none"&©(${"infile".$i},AddSlashes(dirname($PATH_TRANSLATED))."upload".${"infile".$i."_name"})&&unlink(${"infile".$i})){
                $str = ${"infile".$i."_name"};
                echo("<tr>
                    <td width='14%' height='19'>$i</td>
                    <td width='52%' height='19'>$str</td>
                    <td width='34%' height='19'>$fp_size[i]</td>
                    </tr>");
            }
        }

    }
    echo "</table>";             
}

include("../include/footer.inc");

?>  

文档

多文件上载系统完整版

多文件上载系统完整版:<php //多文件上载系统完整版 //功能强大,可任意控制上载文件数,是否覆盖 include("../include/common.inc"); $title = "多个文件的上载程序"; include("../include/header.inc")
推荐度:
标签: 文件 系统 脚本
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top