Skip to content

Commit

Permalink
#8073 removes filename from response
Browse files Browse the repository at this point in the history
  • Loading branch information
sekmiller committed Aug 27, 2021
1 parent 4deb209 commit c15c74b
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/main/java/edu/harvard/iq/dataverse/api/Dataverses.java
Original file line number Diff line number Diff line change
Expand Up @@ -946,10 +946,9 @@ public Response getGroupByOwnerAndAliasInOwner(@PathParam("identifier") String d

@GET
@Path("{identifier}/guestbookResponses/")
@Produces({"application/download"})
public Response getGuestbookResponsesByDataverse(@PathParam("identifier") String dvIdtf,
@QueryParam("guestbookId") Long gbId, @Context HttpServletResponse response) {

try {
Dataverse dv = findDataverseOrDie(dvIdtf);
User u = findUserOrDie();
Expand All @@ -960,13 +959,8 @@ public Response getGuestbookResponsesByDataverse(@PathParam("identifier") String
} else {
return error(Status.FORBIDDEN, "Not authorized");
}

String fileTimestamp = dateFormatter.format(new Date());
String filename = dv.getAlias() + "_GBResponses_" + fileTimestamp + ".csv";

response.setHeader("Content-Disposition", "attachment; filename="
+ filename);
ServletOutputStream outputStream = response.getOutputStream();

ServletOutputStream outputStream = response.getOutputStream();

Map<Integer, Object> customQandAs = guestbookResponseService.mapCustomQuestionAnswersAsStrings(dv.getId(), gbId);

Expand Down

0 comments on commit c15c74b

Please sign in to comment.