紧急救命关于jspSmartUpload
请问使用tomcat做服务器,如果要使用jspSmartUpload应该如何配置。
我试了很多次 快疯了 请哪位大侠救救吧
问题点数:100、回复次数:2Top
1 楼lynx1111(任我行:一个PLMM看着就兴奋的男人)回复于 2003-08-02 13:38:07 得分 80
<%@ 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 2</H1>
<HR>
<%
String name = (String) session.getValue("username");
// Variables
int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
// Upload
mySmartUpload.upload();
// Select each file
for (int i=0;i<mySmartUpload.getFiles().getCount();i++){
// Retreive the current file
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(i);
// Save it only if this file exists
if (!myFile.isMissing()) {
// Save the files with its original names in a virtual path of the web server
myFile.saveAs("/upload/" + myFile.getFileName());
// myFile.saveAs("/upload/" + myFile.getFileName(), mySmartUpload.SAVE_VIRTUAL);
// sample with a physical path
// myFile.saveAs("c:\\temp\\" + myFile.getFileName(), mySmartUpload.SAVE_PHYSICAL);
// Display the properties of the current file
out.println("FieldName = " + myFile.getFieldName() + "<BR>");
out.println("Size = " + myFile.getSize() + "<BR>");
out.println("FileName = " + myFile.getFileName() + "<BR>");
out.println("FileExt = " + myFile.getFileExt() + "<BR>");
out.println("FilePathName = " + myFile.getFilePathName() + "<BR>");
out.println("ContentType = " + myFile.getContentType() + "<BR>");
out.println("ContentDisp = " + myFile.getContentDisp() + "<BR>");
out.println("TypeMIME = " + myFile.getTypeMIME() + "<BR>");
out.println("SubTypeMIME = " + myFile.getSubTypeMIME() + "<BR>");
count ++;
}
}
// Display the number of files which could be uploaded
out.println("<BR>" + mySmartUpload.getFiles().getCount() + " files could be uploaded.<BR>");
// Display the number of files uploaded
out.println(count + " file(s) uploaded.");
%>
<%
%>
</BODY>
</HTML>Top
2 楼lynx1111(任我行:一个PLMM看着就兴奋的男人)回复于 2003-08-02 13:41:12 得分 20
把com.jspsmart.upload.SmartUpload考到WEB-INF/classes目录下
在上文件同级目录下新建文件夹upload~!!Top



