Skip to content

Commit

Permalink
Merge pull request #1400 from petro1/patch-1
Browse files Browse the repository at this point in the history
fix: download file method should have byte[] as response content
  • Loading branch information
gsmet authored Mar 26, 2024
2 parents 74ac4de + afbe5e1 commit ededd15
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public Response uploadFile(FormData formData) throws Exception {
@Produces(MediaType.APPLICATION_OCTET_STREAM)
public Response downloadFile(String objectKey) {
ResponseBytes<GetObjectResponse> objectBytes = s3.getObjectAsBytes(buildGetRequest(objectKey));
ResponseBuilder response = Response.ok(objectBytes.asUtf8String());
ResponseBuilder response = Response.ok(objectBytes.asByteArray());
response.header("Content-Disposition", "attachment;filename=" + objectKey);
response.header("Content-Type", objectBytes.response().contentType());
return response.build();
Expand Down

0 comments on commit ededd15

Please sign in to comment.