You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Thomas Joseph Olaes <co...@olaes.net> on 2004/07/23 20:22:42 UTC

[FileUpload] High-level API... does this work with multipart/form-data as well?

Hello List,

I just realized I had another question, in the javadoc it indicates that
the high level APIs (FileUpload, FileUploadBase, DiskFileUpload) all
work with encoding type "multipart/mixed", but I was wondering if these
apis worked with "multipart/form-data" as well. I tried looking at the
user guide and was running into the problem of the List that I would
generate from upload.parseRequest(request) would return empty when the
encoding type was "multipart/form-data". A bit of research brought me to
the understanding that request is stream, which is why I was trying to
use MultipartStream instead of DiskFileUpload.

How do I use DiskFileUpload with an encoding of type
"multipart/form-data", since I want to use this class to upload a text
file from my browser to a tomcat server JSP page? An answer would be
great, but hints at how to find out for myself would be good too.

Thanks in advance for your help,
-TJ



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: [FileUpload] High-level API... does this work with multipart/form-data as well?

Posted by Martin Cooper <mf...@gmail.com>.
On Fri, 23 Jul 2004 11:22:42 -0700, Thomas Joseph Olaes
<co...@olaes.net> wrote:
> Hello List,
> 
> I just realized I had another question, in the javadoc it indicates that
> the high level APIs (FileUpload, FileUploadBase, DiskFileUpload) all
> work with encoding type "multipart/mixed", but I was wondering if these
> apis worked with "multipart/form-data" as well. I tried looking at the
> user guide and was running into the problem of the List that I would
> generate from upload.parseRequest(request) would return empty when the
> encoding type was "multipart/form-data". A bit of research brought me to
> the understanding that request is stream, which is why I was trying to
> use MultipartStream instead of DiskFileUpload.
> 
> How do I use DiskFileUpload with an encoding of type
> "multipart/form-data", since I want to use this class to upload a text
> file from my browser to a tomcat server JSP page? An answer would be
> great, but hints at how to find out for myself would be good too.

I think perhaps you're misreading the Javadocs. The *primary* purpose
of FileUpload is to handle multipart/form-data. The JavaDoc comments
you are reading simply indicate that, as part of handling
multipart/form-data, FileUpload can handle deal with multipart/mixed
parts.

--
Martin Cooper


> 
> Thanks in advance for your help,
> -TJ
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org