Download a generated file with Action button

Is there a simple way to download a file by pressing an action button?

My code already prepare a proper response with the correct mime type and body but the request is not handled correctly by the browser.
If I cannot use a direct download I need to use a URL but I need to send POST inputs to the request as I'm generating a PDF preview of the form.
Was this page helpful?