KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a multipart form which is supposed to upload a file as well as some parameters. It looks like this: <form id="upload" action="http://localhost:9998/test" method="post" enctype="multipart/form-data"> <input name="inputfile" type="file" size="50" accept="application/octet-stream"> <input name="someparameter" type="text" size="10"> <input type="submit" value="Go!"> </form> The web service looks like this: @Path("/test") public class ServiceInterface { @POST @Consumes(MediaType.MULTIPART_FORM_DATA) public void execute(@FormParam(value="someparameter") String param) { System.out.println(param); } } When submitting the form, the value for "someparameter" is always reported as null although in the form I entered a value. My questions are: What is wrong with the above code? How would I access the file which is transmitted with the form? I am using Jersey 1.10.
Tags (comma-separated)
Save Edits
Cancel