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

fileupload 异常。
commons_fileupload1.1.jar   commons_io1.2.jar
<form   action= "a.jsp "   method= "post "   enctype= "multipart/form-data "   name= "form1 "   id= "form1 ">
<input   type= "file "   name= "file "/>
</form>
DiskFileUpload   fu   =   new   DiskFileUpload();
fu.setSizeMax(size*1024);
fu.setSizeThreshold(4096);
fu.setRepositoryPath(uploadFilePath   +   "/tmp ");
List   fileItems   =   fu.parseRequest(request);//这里抛出异常
Iterator   i   =   fileItems.iterator();
org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:   the   request   doesn 't   contain   a   multipart/form-data   or   multipart/mixed   stream,   content   type   header   is   null
不知道那里有问题。
如果要把DiskFileUpload   换成   ServletFileUpload   怎么改?如何控制他的临时文件?

------解决方案--------------------
commons_fileupload1.1没用过,1.0用过没有问题。