commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: Need help processing multipart data in client application.
Date Tue, 02 May 2006 19:13:33 GMT
You might be able to do this will Commons FileUpload by implementing your
own flavour of the RequestContext interface that isolates the environment.
If you take a look at how the servlet and portlet implementations are done
in FileUpload, you'll find that they provide a very thin layer over an
environment-independent core. All they do is provide a custom RequestContext
and a convenience wrapper for it.

(I haven't tried anything like this, so I can't guarantee that it'll work,
but it seems like it should.)

--
Martin Cooper


On 5/2/06, Kevin Cummings <Kevin.Cummings@cs.oag.state.tx.us> wrote:
>
> I'm hoping someone can help me with a problem I'm having. I have a
> servlet that I've written that processes POST requests and responds with
> a multipart response. My response data looks like:
>
> Content-type: multipart/form-data;
> boundary=--------------------10af66014d5
>
> ----------------------10af66014d5
> Content-Disposition: form-data; name="FileID"
>
> 127709384793
> ----------------------10af66014d5
> Content-Disposition: form-data; name="FileSize"
>
> 10731
> ----------------------10af66014d5
> Content-Disposition: form-data; name="test.zip";
> filename="C:\test.zip"
> Content-Type: application/zip
>
> <zip-file contents>
> ----------------------10af66014d5--
>
> Now, my problem is how can I process this response in my client that
> makes the request to the servlet. All of the examples I've seen only
> work with a ServletRequest object which I don't have because my servlet
> is only responsible for responding to the request and sending the data
> back. Are there any existing libraries that will let me process a
> multipart response as opposed to a multipart request?
>
>
> Thanks!
>
>
> -------------------------------------------------------------------
> Kevin Cummings
> IT/Systems Development
> Child Support Division
> Texas Office of the Attorney General
> Email: kevin.cummings@cs.oag.state.tx.us
> Phone: (512) 460-6421
> Fax: (512) 460-6800
> -------------------------------------------------------------------
>
>

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