Downloading a file from spring controllers

前端 未结 14 1127
渐次进展
渐次进展 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:47

    This can be a useful answer.

    Is it ok to export data as pdf format in frontend?

    Extending to this, adding content-disposition as an attachment(default) will download the file. If you want to view it, you need to set it to inline.

提交回复
热议问题