resolve debate export problem

This commit is contained in:
ArenMg 2021-05-23 01:46:01 +03:00
parent eba6a08a96
commit 73bee4fbe3

View file

@ -492,7 +492,8 @@ public class DebateRESTFacade extends AbstractRESTFacade<Debate> {
public Response export(@PathParam("id") Long id) throws Exception { public Response export(@PathParam("id") Long id) throws Exception {
Debate debate = debateService.findByUser(id, getUser(), true, true, false, false, false); Debate debate = debateService.findByUser(id, getUser(), true, true, false, false, false);
File export = odfService.parseDebate(debate); File export = odfService.parseDebate(debate);
String fileName = debate.getDocument().getName().replaceAll("[^a-zA-Z0-9\\s]", "") + ".odt"; // String fileName = debate.getDocument().getName().replaceAll("[^a-zA-Z0-9\\s]", "") + ".odt";
String fileName = "aren_export_" + System.currentTimeMillis() + ".odt";
return Response.ok(export) return Response.ok(export)
.header("Content-disposition", "attachment; filename=\"" + fileName + "\"") .header("Content-disposition", "attachment; filename=\"" + fileName + "\"")
.header("Content-length", export.length()) .header("Content-length", export.length())