日期:2014-05-18  浏览次数:20735 次

struts中用smartupload上传文件问题--死循环
SmartUpload   mySmartUpload   =   new   SmartUpload();
mySmartUpload.initialize(getServlet().getServletConfig(),request,response);
mySmartUpload.upload();
执行到这里就不动了,死循环,看源码,就是这里死循环
for   (;   -1   <   i   &&   i   <   totalBytes;   i   =   i   +   j)   {
try   {
request.getInputStream();
j   =   request.getInputStream().read(binArray,   i,   totalBytes   -   i);
}   catch   (Exception   exception)   {
throw   new   FwUploadException( "Unable   to   upload. ");
}
}
然后添加如下代码
if   (j   ==   -1)
throw   new   Exception();
还是不行,直接就出来了,
怎么办,水能告诉我,谢谢
如果有现成的例子发到我的邮箱,只要解决问题,马上给分




------解决方案--------------------
http://www.cs.utexas.edu/users/s2s/latest/icc1a/src/upload_system/jspsmartupload/

上面的目录里面就有