想问下谁有使用过jspsmartupload的成功例子?
我在smartupload.upload()这里老过不去,文件很小也不行,有朋友遇到这种情况吗?怎么处理的,下面是我的upload.jsp代码。大家大研究下。
<HTML> <HEAD> <TITLE> 上传成功! </TITLE>
<META content= "text/html; charset=gb2312 " http-equiv=Content-Type>
</HEAD>
<BODY leftMargin=0 topMargin=0>
<jsp:useBean id= "mySmartUpload " scope= "page " class= "com.sztelecom.csc.mcms.tools.SmartUpload " />
<table width= "80% " border= "0 " cellpadding= "0 " cellspacing= "0 " bgcolor= "#DEE7EF ">
<tr>
<td align= "center ">
<%
String fileName = null;
com.sztelecom.csc.mcms.tools.SmartFile myFile =null;
try{
mySmartUpload.initialize(pageContext);
mySmartUpload.setMaxFileSize(1024 * 1024*1024) ;
mySmartUpload.upload();}
catch (Exception e){
System.out.println( "上传文件太大 ");
}
for (int i=0;i <mySmartUpload.getFiles().getCount();i++){
myFile = mySmartUpload.getFiles().getFile(0);
if (!myFile.isMissing()) {
//String ext=myFile.getFileExt();//得到后缀
fileName = myFile.getFileName();
myFile.saveAs( "e:/home/ " + fileName);//你要存放文件所在文件夹的相对路径
System.out.println( "文件: <b> "+fileName+ " </b> 上传成功! <br/> 文件大小: " + myFile.getSize() + "kb <BR> ");
}
else{System.out.println( "出错 ");}
}
%>
</BODY> </HTML>
到底是那里的问题?
------解决方案--------------------d
------解决方案--------------------我有的