jsp图片上传问题 有一个问题,关于JS的,就是在后台上传一个d:\My Documents\My Pictures\015.jpg图片后,我想让这个文件名(015.jpg)出现在我另一个页面的文本框中,怎么实现呀,各位大侠帮忙看看 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用split方法分割"\"取最后一个就是 015.jpg了...你是用什么方法打开上传页面的?如果是子页面的话window.opener.document.blogFileForm.fileName.value=fileName;//blogFileForm 是你form的名字,fileName是文本框的名字//window.opener.document.getElementById("fileName").value=fileName; 看看我的上传文件例子吧,实现了你需要的。http://download.csdn.net/user/wula0010:多文件上传例子 这是我的第一个页面upload.jsp<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %><html><head><title>上传文件</title></head><body><form id="form1" name="msform" method="post" action="do_upload.jsp" enctype="multipart/form-data" onSubmit="return Check_Found(this);"><%String files=(String)session.getAttribute("files");%><table width="50%" border="1" align="center"> <tr> <td align="center"><input type="text" name="name"></td> </tr> <tr> <td align="center">产品说明: <input type="file" name="file2" value="<%=files%>"/> <input type="submit" name="Submit" value="上传图片" /></td> </tr></table></form></body></html>这是第二个页面do_upload.jsp<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %><html><head><title>文件上传处理页面</title></head><body><% SmartUpload su=new SmartUpload(); su.initialize(pageContext); su.upload(); String name; int count=su.save("/upload",su.SAVE_VIRTUAL); out.println(count+"个文件上传成功!<br>"); for(int i=0;i<su.getFiles().getCount();i++) { com.jspsmart.upload.File file=su.getFiles().getFile(i); if(file.isMissing()) continue; String files=file.getFileName(); }%></body></html>要让他的上传的文件名出现在第一个页面中的文本框中 什么是shell编程,shell编程难吗? 下面有个网站MS是做旅行搜索引擎的,大家知道是用什么技术实现的吗? 谁有JXL包 请问在oracle数据库中,如何用sql实现随机记录? tomcat运行带有数据库查询的页面时速度超慢 请问jsp里面怎么得到满足某个查询的记录条数的?? 问一个简单地 闷!散分啦! 在jsp中如何判断结果集为空?重定向用什么语句??在线等!!!! 高分!!!急求JSP论坛源代码!!!!急!!(200分,分贴给分) 真的要求救了,谁能帮帮我,快点啊,天啊!!!!!!! 帮忙看一下这句代码错在哪里
取最后一个就是 015.jpg了...
你是用什么方法打开上传页面的?
如果是子页面的话
window.opener.document.blogFileForm.fileName.value=fileName;//blogFileForm 是你form的名字,fileName是文本框的名字
//window.opener.document.getElementById("fileName").value=fileName;
http://download.csdn.net/user/wula0010:多文件上传例子
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %>
<html>
<head>
<title>上传文件</title></head>
<body>
<form id="form1" name="msform" method="post" action="do_upload.jsp" enctype="multipart/form-data" onSubmit="return Check_Found(this);">
<%String files=(String)session.getAttribute("files");%>
<table width="50%" border="1" align="center">
<tr>
<td align="center"><input type="text" name="name"></td>
</tr>
<tr>
<td align="center">产品说明:
<input type="file" name="file2" value="<%=files%>"/>
<input type="submit" name="Submit" value="上传图片" /></td>
</tr>
</table>
</form>
</body>
</html>
这是第二个页面do_upload.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.util.*,com.jspsmart.upload.*" %>
<html>
<head>
<title>文件上传处理页面</title>
</head>
<body>
<%
SmartUpload su=new SmartUpload();
su.initialize(pageContext);
su.upload();
String name;
int count=su.save("/upload",su.SAVE_VIRTUAL);
out.println(count+"个文件上传成功!<br>");
for(int i=0;i<su.getFiles().getCount();i++)
{
com.jspsmart.upload.File file=su.getFiles().getFile(i);
if(file.isMissing()) continue;
String files=file.getFileName();
}
%>
</body>
</html>
要让他的上传的文件名出现在第一个页面中的文本框中