文件上传例外

时间:2015-03-25 06:15:15

标签: jsp file-upload apache-commons-fileupload

我尝试使用Apache Commons上传文件但引发了以下异常

请求中不包含multipart/form-datamultipart/mixed streamcontent type标题为null

html代码

Form method="post" action="getData.jsp" enctype="multipart/form-data"    
input type="file" name="upload"

JSP代码

 DiskFileUpload upload = new DiskFileUpload();         
 boolean isMultipart=upload.isMultipartContent(request);   


List items = upload.parseRequest(request); //this line throw exception.

我哪里错了?

0 个答案:

没有答案