smart上传文件遇到的问题,请高人指教
public void performTask(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) {
int count=0;
String filename="";
SmartUpload mySmartUpload = new SmartUpload();
try
{
mySmartUpload.initialize(config,request,response);
mySmartUpload.upload();
com.jspsmart.upload.File myFile = mySmartUpload.getFiles().getFile(0);
filename=myFile.getFileName();
System.out.println(filename);
count = mySmartUpload.save(mySmartUpload.getRequest().getParameter("PATH"),mySmartUpload.SAVE_VIRTUAL);//如果这样写,没有错误
//myFile.saveAs(mySmartUpload.getRequest().getParameter("PATH")+"myfile.txt",myFile.SAVEAS_VIRTUAL);//如果这样写,没有报错,但是没有文件传上去?
System.out.println(count + " file uploaded.");
}
catch(Throwable theException)
{
System.out.println(theException);
}
}
以上是原码
我想在文件上传到服务器后用我定义的文件名存放,请大家指教该怎么做,谢谢