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%!我试了很多次,
将代码改为其他均不行。
不知道什么原因!
// 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%!我试了很多次,
将代码改为其他均不行。
不知道什么原因!