zoukankan      html  css  js  c++  java
  • javascrpt多文件上传文件

    <HTML>
    <HEAD><TITLE>上传文件</TITLE>
    <SCRIPT language=javascript type=text/javascript>
    <!--
    var RES_BT_DELETE = "删除";
    var isIE = (navigator.userAgent.indexOf("MSIE") != -1);
    var fileIndex = 0;function addFile() {
     var spanId = "filespan";
     var fileId = "uploadfile" + (fileIndex++);
     addInputFile(spanId, fileId);
    }function addInputFile(spanId, fileId) {
     var span = document.getElementById(spanId);
     if (span != null) {
     var divObj = document.createElement("div"), fileObj, delObj;
     divObj.id = fileId;
     if (isIE) {
     fileObj = document.createElement("<input type=file onchange=changeFile(form)>");
     delObj = document.createElement("<input type=button onclick=delInputFile('" + spanId + "','" + fileId + "')>");
     } else {
     fileObj = document.createElement("input");
     fileObj.type = "file";
     fileObj.setAttribute("onchange", "changeFile(form)", 0);
     delObj = document.createElement("input");
     delObj.type = "button";
     delObj.setAttribute("onclick", "delInputFile('" + spanId + "','" + fileId + "')", 0);
     }
     fileObj.name = fileId;
     fileObj.size = "40";
     fileObj.className = "input";
     delObj.value = RES_BT_DELETE;
     divObj.appendChild(fileObj);
     divObj.appendChild(document.createTextNode(" "));
     divObj.appendChild(delObj);
     span.appendChild(divObj);
     }
    }function delInputFile(spanId, fileId) {
     var span = document.getElementById(spanId);
     var divObj = document.getElementById(fileId);
     if (span != null && divObj != null) {
     span.removeChild(divObj);
     }
    }
    //-->
    </SCRIPT>
    <META content="MSHTML 6.00.2800.1528" name=GENERATOR>
    </HEAD>
    <BODY class=pagebackground>
    <FORM id=form action=XXX method=post encType=multipart/form-data>
    <TABLE class=dialog1 height=20 cellSpacing=1 cellPadding=8 width="90%" align=center>
     <TBODY>
     <TR>
     <TD noWrap>通过文件上传: </TD>
     <TD id=filespan noWrap>
     <INPUT class=input type=file size=40 name=file>
     <INPUT id=btnAdd onclick=addFile() type=button value=添加>
     </TD>
     </TR>
     </TBODY>
    </TABLE>
    </FORM>
    </BODY></HTML>
  • 相关阅读:
    IDEA如何打包可运行jar的一个问题。
    从一个脚本谈loadrunner的脚本初始化
    explain 用法详解
    linux zip 命令详解
    Jmeter使用——参数化
    Jmeter Constant Throughput Timer 使用
    产生随机时间的例子
    Mysql的列索引和多列索引(联合索引)
    Loadrunner负载机agent
    Spring context:property-placeholder 一些坑
  • 原文地址:https://www.cnblogs.com/winner/p/340157.html
Copyright © 2011-2022 走看看