commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: File Upload Exception - request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is application/x-www-form-urlencoded
Date Fri, 08 Feb 2008 04:50:46 GMT
On Feb 7, 2008 8:15 PM, Edward S <suminub@gmail.com> wrote:

> Hey guys,
>
> I am tryin to upload a JPG file and am getting this error:
>
>
> org.apache.commons.fileupload.FileUploadBase$InvalidContentTypeException:the
> request doesn't contain a multipart/form-data or multipart/mixed
> stream,
> content type header is application/x-www-form-urlencoded
>
>
> let me explain what I am doing:
>
> I have a JSP that has the form that does the file upload. the enctype on
> the
> form is "multipart/mixed"


That's the problem, assuming you are submitting from a browser. AFAIK,
'multipart/mixed' is neither valid nor supported in HTML, so the browser is
ignoring your value and falling back to the HTML default, which is
'application/x-www-form-urlencoded'. To post the file, you'll need to use
'multipart/form-data'.

--
Martin Cooper



> this JSP is included in a root JSP and the action submits the form to the
> root JSP.
>
> Root JSP has a controller, that processes the request. When it tries to
> process this request, it gives me the above mentioned error.
>
> Any idea, where I am going wrong?
>
> thanks
>
> Ed.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message