使用SmartUpload上傳文件不成功
使用SmartUpload上傳文件沒有報錯,但save時返回的值是0,為什么?
SmartUpload su=new SmartUpload();
su.initialize(getServletConfig(), request, response);
su.setMaxFileSize(1024*1024*10);
su.setTotalMaxFileSize(1024*1024*100);
su.setAllowedFilesList("jpg,jpeg,bmp,png,gif");
String saveFilePath=getServletContext().getRealPath("/")+"uploadFile";
try {
su.upload();
File path=new File(saveFilePath);
if(!path.exists()){
path.mkdir();
}
int uploadCount=su.save(saveFilePath);
request.getSession().setAttribute("result", "上傳成功"+uploadCount);
response.sendRedirect("collectIdea.jsp");
2016-08-18
同問?。?!
2016-06-01
我也是,怎么解決??!
2016-03-19
使用SmartUpload上傳文件沒有報錯,但save時返回的值是0,為什么?
SmartUpload su=new SmartUpload();
su.initialize(getServletConfig(), request, response);
su.setMaxFileSize(1024*1024*10);
su.setTotalMaxFileSize(1024*1024*100);
su.setAllowedFilesList("jpg,jpeg,bmp,png,gif");
String saveFilePath=getServletContext().getRealPath("/")+"uploadFile";
try {
su.upload();
File path=new File(saveFilePath);
if(!path.exists()){
path.mkdir();
}
int uploadCount=su.save(saveFilePath);
request.getSession().setAttribute("result", "上傳成功"+uploadCount);
response.sendRedirect("collectIdea.jsp");