I get a deployment from a software to my Jersey REST WebService that should receive a xml-File.
If I receive it with:
<code>
@POST
@Path("/deployment")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public String deploy(@FormDataParam("upload") final String upload) {...}
</code>
I get the complete Post (written below) in one String (including the byte[] withe the fileData. The problem is, that I donīt get the fileData extracted out of that String in a "clean" way.
If I try to receive the POST with:
<code>
@POST
@Path("/deployment")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public String deploy(@FormDataParam("upload") final <b>FormDataMultiPart </b>upload) {...}
</code>
I get an Error "...isnīt compatible with the MIME media type...".
Addind the mimepull.jar also didnīt solve the problem.
As I found out it looks like a standard FileUpload POST that should be received with FormDataMultiPart and then the file could be extracted as a stream for example. But that doesnīt run in my case. What can I do to get my file saved on the server?
Bookmarks