Downloading a file from spring controllers

前端 未结 14 1175
渐次进展
渐次进展 2020-11-22 01:06

I have a requirement where I need to download a PDF from the website. The PDF needs to be generated within the code, which I thought would be a combination of freemarker and

14条回答
  •  [愿得一人]
    2020-11-22 01:45

    If it helps anyone. You can do what the accepted answer by Infeligo has suggested but just put this extra bit in the code for a forced download.

    response.setContentType("application/force-download");
    

提交回复
热议问题