请问如何在jsp/servlet中实现上载文件!哪里有资料?

kobe_lee 2001-06-30 04:11:13
...全文
70 点赞 收藏 6
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
baby213 2001-07-02
你上网上找www.google.com网上查找一下很多的
回复
kobe_lee 2001-07-02
给你了5分!
回复
kobe_lee 2001-07-02
多谢!coolknight()
回复
coolknight 2001-07-01
<HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <FORM METHOD="POST" ACTION="/jspsmartupload/sample1.jsp" ENCTYPE="multipart/form-data"> <INPUT TYPE="FILE" NAME="FILE1" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE2" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE3" SIZE="50"><BR> <INPUT TYPE="FILE" NAME="FILE4" SIZE="50"><BR> <INPUT TYPE="SUBMIT" VALUE="Upload"> </FORM> </BODY> </HTML>


<%@ page language="java" import="com.jspsmart.upload.*"%> <jsp:useBean id="mySmartUpload" scope="page" class="com.jspsmart.upload.SmartUpload" /> <HTML> <BODY BGCOLOR="white"> <H1>jspSmartUpload : Sample 1</H1> <HR> <% // Variables int count=0; // Initialization mySmartUpload.initialize(pageContext); mySmartUpload.setTotalMaxFileSize(100000); // Upload mySmartUpload.upload(); try { // Save the files with their original names in the virtual path "/upload" // if it doesn't exist try to save in the physical path "/upload" count = mySmartUpload.save("/upload"); // Save the files with their original names in the virtual path "/upload" // count = mySmartUpload.save("/upload", mySmartUpload.SAVE_VIRTUAL); // Display the number of files uploaded out.println(count + " file(s) uploaded."); } catch (Exception e) { out.println(e.toString()); } %> </BODY> </HTML>
回复
coolknight 2001-07-01
下一个jspsmartupload,看它自带的例子
http://www.jspsmart.com 下载
记得给分啊!!!
回复
kobe_lee 2001-07-01
不给分就没人帮我吗?
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-06-30 04:11
社区公告
暂无公告