java - Entire multipart payload coming as a single FormDataParam using Jersey -


i using jersey build rest service upload file. method starts this:

@post @consumes(mediatype.multipart_form_data) @produces({ mediatype.application_json }) @path("/upload") public string upload(     @formdataparam("one") string one,     @formdataparam("two") string two,     @formdataparam("file") inputstream file) { 

when posting request resource "one", "two" , "file" form fields, entire payload, including binary file data , multipart boundaries, in variable "one", instead of each variable getting respective value form fields.

what going wrong here?

edit: client, have used html:

<!doctype html> <html> <head> <meta charset="iso-8859-1"> <title>insert title here</title> </head> <body>      <form method="post" action="/upload"         enctype="multipart/form-data">         one: <input type="text" name="one" />          two: <input type="text" name="two" />          file: <input type="file" name="file" />         <input type="submit" name="submit" />     </form> </body> </html> 

i have tried using postman rest client chrome.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -