0

I tried to use the file upload using Apache Commons but the following exception thrown

the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null

html code

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

JSP code

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


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

Where am i going wrong?

Santhosh
  • 8,181
  • 4
  • 29
  • 56
  • Post the stacktrace of your exception , **P.S Pls dont use jsp for file-upload servlets are meant for that purpose** – Santhosh Mar 25 '15 at 06:27
  • http://stackoverflow.com/questions/2422468/how-to-upload-files-to-server-using-jsp-servlet?rq=1 – Amit Mar 25 '15 at 06:34

0 Answers0