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.
5 Replies
?
Its a stream tho. Its not a stored file
I'm taking the form data via $get and passing it to a service that generate a PDF
the pdf is not stored. i've tried with the livewire:
When using this for a file for a model, it says:
unable to retrieve the file_size for file at location sd02380jsf.jpg for example.
Are you trying to download it before persisting it to storage?
Can you share the code of your actual action?
Yes, it is a http response with proper headers set. As it is a preview/draft it is not stored on the storage.
I can provide an example!
The code is basically:
@Leandro Ferreira
If necessary I can update my previous repo demo with such example.