100分求助,Linux + Apache Tomcat/5.0.27 + JSP + SmartUpload 附件上传出错!
代码如下:
<%
try { int count=0;
// Initialization
mySmartUpload.initialize(pageContext);
mySmartUpload.setAllowedFilesList("jpg,JPG,jpeg,JPEG,bmp,BMP,gif,GIF,tif,TIF,tiff,TIFF,psd,PSD");
mySmartUpload.setTotalMaxFileSize(6000000);
// Upload
mySmartUpload.upload();
// 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(getServletContext().getRealPath("/")+"/caricature/caricatureorder/step1/uploadTest/");
// 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("<script language='javascript'>alert('Success! " + count + " file(s) uploaded');parent.document.all.spUpFont.style.display='none';parent.document.frmHYDJ.txtFile1.value = parent.document.FileFrm1.photo1.value;parent.document.frmHYDJ.txtFile2.value = parent.document.FileFrm1.photo2.value;parent.document.frmHYDJ.txtFile3.value = parent.document.FileFrm1.photo3.value;</script>");
//out.println(count + " file(s) uploaded. by test");
} catch (Exception ex) {
out.println("<script language='javascript'>alert('Lose! " + ex.toString() + "(We only accept:jpg,jpeg,bmp,gif,tif,tiff,psd)');parent.document.all.spUpFont.style.display='none';parent.document.all.spUpload.style.display='';</script>");
out.println(ex.toString() + "<br>");
}
%>
错误提示为:
jspSmartUpload : Sample 1
--------------------------------------------------------------------------------
java.security.AccessControlException: access denied (java.io.FilePermission /var/chroot/home/content/o/s/o/osoqnet/html/caricature/caricatureorder/step1/uploadTest/10bea24da4c.jpg write)
程序是在外网上运行,以前服务器用的是WINDOWS的系统,上传一直都没问题。最近换了Linux的服务器,就不能上传了,服务提供商也不知道是哪里出错或哪里设置不对。
请各位高手帮忙指点一下,万分感谢!!!