Hi Max,
Currently @FormParam only works correctly for the media type:
application/x-www-form-urlencoded
For the moment you need to use the JavaMail API and the type:
javax.mail.internet.MimeMultipart
which i fully admit is not as nice as you would like.
I think it possible to support "multipart/form-data" by utilizing the
JavaMail API under the covers, just a matter of getting the time to
program it... (Plus i don't want to introduce a direct dependency on the
JavaMail jars.)
Paul.
Max Scheffler wrote:
> Hi,
>
> i want to create an image resource by uploading an image and setting
> some informations for this image.
>
> The following is a possible POST body:
>
> Content-type: multipart/form-data, boundary=AaB03x
>
> --AaB03x
> content-disposition: form-data; name="field1"
>
> Joe Blow
> --AaB03x
> content-disposition: form-data; name="pics"; filename="file1.txt"
> Content-Type: text/plain
>
> ... contents of file1.txt ...
> --AaB03x--
>
> I tried to use the following code:
>
> @POST
> public Response createGraphic ( @FormParam( "field1" ) String name,
> @FormParam( "pics" ) Object object ) {
> ...
> }
>
> But this approach didn't work fine.
>
> How can I fetch the parameters (in this example: field1) and the file?
>
> Greetings
> Max
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109