请问有不用包,知道文件的路径,可以把文件上传到本地吗?

解决方案 »

  1.   

    我把从<input id="t1" type="file" style="display:none">中取到的好几个文件,都放到select中,在处理页面只能在select中取得路径,这样怎么上传到本地?就是不用什么smartupload等
      

  2.   

    <input id="t1" type="file" style="display:none">在这选的文件,把路径取出来放到select中,在另外一个页面怎么上传到某个目录,如D盘
      

  3.   

    我那有文件上传的下载包。里面有例子。看了就知道了。“http://download.csdn.net/source/1466421”
      

  4.   

    下载 写个超链接就可以了  上传 apache的common-fileupload 挺好用    
      

  5.   

    <input id="t1" type="file" > 标签只能选一个具体的文件吧,你可以在程序中获取用它选的文件路径,去掉文件名变成一个目录,创建File类,然后使用File类的list方法列出目录下的所有文件,再显示到select中,选择select的某项后,服务器端用流来读文件就可以了。
      

  6.   

    我的代码,那位高手看一下,解决一下?能解决立马给分
    <%@page contentType="text/html; charset=GBK" import="java.util.*,java.sql.*,ahsl.*,java.text.*"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
       <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
        <title></title>
        <link href="css/sub.css" rel="stylesheet" type="text/css" />
      </head>
      <script src="scripts/prototype.js"></script>
      <script type="text/javascript">
    function aa(){
       document.fileForm.t1.click();
    var val=document.fileForm.t1.value; 
    if(val==""){
    return;
    }else{
    var tt=document.fileForm.sele;
    var tiem=document.createElement("OPTION");
    tt.options.add(tiem);
    tiem.value=val;
    tiem.innerText=val;
    document.fileForm.t1.value=""
    var v=document.fileForm.t1.value;
    alert(v);
    }

    </script>
      <body>
     <form action="upfile.jsp" name="fileForm" method="post"> 
    <table>
    <tr>
    <td align="right">上传附件:</td>
    <td align="left">
    <input id="t1" type="file" style="display:block"><p> 
    <select style="FONT-SIZE: 12px; WIDTH: 80%; COLOR: #006cad; BACKGROUND-COLOR: #ffffff" multiple="multiple" size="12" name="sele" id="sele">
    </select> 
    </td>
    <td>
    <input type=button value="上传文件" style="font-size:12px;height:19"onclick="blur();aa()"/><br/>
    <input type="button" value="删除附件" onclick="dele()" style="font-size:12px;height:19"/>
    </td>
    </tr>
    <tr><td colspan="3"></td></tr>
    <tr><td colspan="3" align="center"><input  type="submit" class="button" value="提交"/>
    &nbsp;&nbsp;<input type="reset" class="button" value="重置" /></td>
    </tr>
    </table>
    </form>
      </body>
    </html>
    跳到upfile.jsp后怎么上传所有select中的选项