Hi,

I'm facing different behaviours with MultipartBody on REST services. When
using MultipartBody as a return value on a service method annotated with
jax-rs annotation like:

@GET
@Path("/downloadFile/{ticket}/{fileId}")
@Produces("multipart/mixed")
MultipartBody downloadFile(@PathParam("ticket") String
ticket, @PathParam("fileId") String fileId) throws IOException;

Internet Explorer cannot download the file being included in MultipartBody
correctly, but shows only the binary content of MultipartBody (the file
being included in it). Chrome and Safari is downloading the content of the
file nicely, but is not showing the file name that is specified as:

MultipartBody multipartBody = new MultipartBody(new Attachment("eclosure",
new FileInputStream(file),
 new ContentDisposition("attachment;filename=" +
fileInfo.getFileNameWithCpr())));

Only the Fifefox is downloading the file as expected.

Any help will be appriciated.

Piotr

Reply via email to