Downloading PDF for clients

Hey there,

I’m trying to download a generated PDF which I store locally (for now). The generation of the PDF works and I can check the PDF in my IntelliJ.

When I try to download it to the client through response.download(fileName) it doesn’t trigger a download on the client, but I get a response with status 200 OK.

This is how I return from the server (I also tried response.attachment, didn’t work):
if(fileExists) { response.download(Helpers.tmpPath('test.pdf')); }

Does anyone know how I should approach this?

Thanks in advance!

1 Like

When you say it doesn’t work, what’s the behavior you are getting?

I’m getting a status 200 OK with some kind of small hash as the response. I would think that it would trigger a download in the client.

Are you opening it inside a browser?

Yes I’m opening it in Chrome, when I use Postman a download pop-up is triggered, but not in the browser itself.

Were you able to solve this?

Were you able to solve this? Still facing the same problem.