文件上传的问题,高手进来啊 请问有不用包,知道文件的路径,可以把文件上传到本地吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我把从<input id="t1" type="file" style="display:none">中取到的好几个文件,都放到select中,在处理页面只能在select中取得路径,这样怎么上传到本地?就是不用什么smartupload等 <input id="t1" type="file" style="display:none">在这选的文件,把路径取出来放到select中,在另外一个页面怎么上传到某个目录,如D盘 我那有文件上传的下载包。里面有例子。看了就知道了。“http://download.csdn.net/source/1466421” 下载 写个超链接就可以了 上传 apache的common-fileupload 挺好用 <input id="t1" type="file" > 标签只能选一个具体的文件吧,你可以在程序中获取用它选的文件路径,去掉文件名变成一个目录,创建File类,然后使用File类的list方法列出目录下的所有文件,再显示到select中,选择select的某项后,服务器端用流来读文件就可以了。 我的代码,那位高手看一下,解决一下?能解决立马给分<%@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="提交"/> <input type="reset" class="button" value="重置" /></td> </tr></table></form> </body></html>跳到upfile.jsp后怎么上传所有select中的选项 javase里面如何实现setattribute功能??? 在线求解,(统计字符串中的英文字母数量,并替换成下划线) 求一字符串x(标题过短的设定怎么这么郁闷) 若抽象类没有抽象方法要怎么继承? 求份1.4的中文版本的api 请教一个修改方法名称的问题。 怎么对我的数据库进行保护 我要学java2,因为现在java太好啦,请您提点建议。 通过socket接受到网络字节顺序发送的4个字节,已知道到此4字节代表一整数,那么怎样将此4字节转换成整数? FileOutputStream 大哥们 进来帮我看一下 JTable 中Boolean类型显示问题
<%@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="提交"/>
<input type="reset" class="button" value="重置" /></td>
</tr>
</table>
</form>
</body>
</html>
跳到upfile.jsp后怎么上传所有select中的选项