<%@ page contentType="text/html; charset=gb2312" buffer="1" autoFlush="true"%><%@ page import="com.jspsmart.upload.*" %>
<body><%
SmartUpload upload = new SmartUpload();
upload.initialize(pageContext);
upload.upload();
for (int i=0;i<upload.getFiles().getCount();i++){
com.jspsmart.upload.File newFile = upload.getFiles().getFile(i); if (!newFile.isMissing()) { newFile.saveAs("d:/websrc/upload/" + newFile.getFileName());//修改你的存储路径
out.println("FieldName = " + newFile.getFieldName() + "<BR>");
out.println("Size = " + newFile.getSize() + "<BR>");
out.println("FileName = " + newFile.getFileName() + "<BR>");
out.println("FileExt = " + newFile.getFileExt() + "<BR>");
out.println("FilePathName = " + newFile.getFilePathName() + "<BR>");
out.println("ContentType = " + newFile.getContentType() + "<BR>");
out.println("ContentDisp = " + newFile.getContentDisp() + "<BR>");
out.println("TypeMIME = " + newFile.getTypeMIME() + "<BR>");
out.println("SubTypeMIME = " + newFile.getSubTypeMIME() + "<BR>"); } }
%>
</body>
<body><%
SmartUpload upload = new SmartUpload();
upload.initialize(pageContext);
upload.upload();
for (int i=0;i<upload.getFiles().getCount();i++){
com.jspsmart.upload.File newFile = upload.getFiles().getFile(i); if (!newFile.isMissing()) { newFile.saveAs("d:/websrc/upload/" + newFile.getFileName());//修改你的存储路径
out.println("FieldName = " + newFile.getFieldName() + "<BR>");
out.println("Size = " + newFile.getSize() + "<BR>");
out.println("FileName = " + newFile.getFileName() + "<BR>");
out.println("FileExt = " + newFile.getFileExt() + "<BR>");
out.println("FilePathName = " + newFile.getFilePathName() + "<BR>");
out.println("ContentType = " + newFile.getContentType() + "<BR>");
out.println("ContentDisp = " + newFile.getContentDisp() + "<BR>");
out.println("TypeMIME = " + newFile.getTypeMIME() + "<BR>");
out.println("SubTypeMIME = " + newFile.getSubTypeMIME() + "<BR>"); } }
%>
</body>
解决方案 »
- 新手关于jsp和java之间数据传递的问题
- 请教各位几个关闭JAVA基本概念的问题!有兴趣朋友可以来看看
- String term = srcRow.getString("编号")+"&"+srcRow.getString("相别");怎么不对啊?
- jsp下载中文文件出现乱码
- 请问一个关于JAVA判断条件的脚步代码。
- javaweb传送对象是怎样实现的?
- 求一簡單正則表達式(急,在線等)
- Struts标签问题(问了N个人了)!!!!!!!!!!!!!!!!!!!
- 高分求:JSP或JAVA调用EXCEL打印,预览,另存功能,都半个月了一个进展也没有???
- 帮小弟看一下程序,好像写的没问题,可运行就是不显示,只有10分了,不好意思
- 如何使用JSP读取SQLServer中的ntext字段?当数据库的字段的数据显示为<Long Text>时,就会有乱码?
- 有多少人在用Netscape?
改为:
newFile.saveAs("/upload" + newFile.getFileName());//修改你的存储路径/upload 为web server 的根目录下的所要上传文件的目录。顺便问一下:你在linux 服务器下。能上传所有文件吗?我有些文件不能上传!!!