I need to return zip file in my rest Api but i receive MIME media type application/zip was not found.
@Produces({ "application/zip" })
public Response convertFile(){
.
.
.
return Response.ok(result, "application/zip").build();
}
Try this:
@Produces("application/zip")
return Response
.ok(FileUtils.readFileToByteArray(resultFile))
.type("application/zip")
.header("Content-Disposition", "attachment; filename=\"yourfile.zip\"")
.build();