用SmartUpload的时候遇到了问题!急!(100分)

  • 主题发起人 yanliang
  • 开始时间
Y

yanliang

Unregistered / Unconfirmed
GUEST, unregistred user!
我的代码如下:
// Variables
int count=0;

// Initialization
mySmartUpload.initialize(pageContext);
mySmartUpload.setTotalMaxFileSize(100000);
// Upload
mySmartUpload.upload();
try {
// Save the files with their original names in the virtual path "/upload"
// if itdo
esn't exist try to save in the physical path "/upload"
count = mySmartUpload.save("/upload");
// 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(count + " file(s) uploaded.");
} catch (Exception e) {
out.println(e.toString());
}
这个代码应该没有问题,很多人都用这个的。
现在我的问题是:只要一开始上传文件,不管这个文件有多大,哪怕是几十个字节,
机子都会变的巨慢!我一查CPU的占用率,java.exe的占用率为100%!我试了很多次,
将代码改为其他均不行。
不知道什么原因!
 
没有人会吗?
 
count = mySmartUpload.save("/upload");
 
问题已经解决。
主要是上一页的FORM有个属性叫ENCTYPE="multipart/form-data",必须把这个东西带上。
不然当数据POST到这个页面的时候SmartUpload一直在数据中找ENCTYPE="multipart/form-data",
如果数据中没有这个东西就会死循环。
 
顶部