js上传图片路径问题

zhangbolang8888 2009-02-24 04:19:26
第一个页面是:first.jsp
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<form id="form1" name="form1" method="post" action="upload.jsp">
<table width="80%" border="0">
<tr>
<td width="54%" align="center"><input type="text" name="textfield" /></td>
<td width="46%"><input type="submit" name="Submit" value="上传图片" /></td>
</tr>
</table>
</form>
</body>
</html>

第二个页面: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);">
<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=""/>
<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>
要让他的上传的文件名出现在第一个页面中的文本框中
...全文
399 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

24,923

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Apache
社区管理员
  • Apache
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧