Eggington
Eggington5mo ago

Returning a PDF from a webhook

I have a windmill endpoint that I am trying to return a pdf file from my connected azure blob container. I saw in the docs how I can set a custom response content-type via windmill_content_type, which I set to application/pdf, i set the result to my raw pdf bytes, but the response in the browser had no body content. Is there a way I can return a PDF from a windmill webhook?
6 Replies
rubenf
rubenf5mo ago
Are you using the S3 object result ? (I assume you're using the S3 integration). If yes, it will display a link to the user one can download from
Eggington
EggingtonOP5mo ago
i am using wmill.loadS3File and returning that response currently. I think my original message might be wrong, the response in the network tab contained nothing, but the preview tab did show the Uint8Array
rubenf
rubenf5mo ago
You don't need to load the S3 file The frontend can do it for you Just return the path using an S3 object And show it in a rich result component It will display a button to download
Eggington
EggingtonOP5mo ago
the purpose of displaying this at the moment is just a stepping-stone to make sure I am accessing the pdf properly. We will be creating a new PDF off of this template PDF (using pdf-lib to edit it) and then will have to share the new PDf bytes to the frontend to our frontend that is, we have to get the PDF to our frontend via the webhook
rubenf
rubenf5mo ago
I recommend storing the result in s3, and then sharing the path/using the s3 object
Eggington
EggingtonOP5mo ago
ah okay, thank you for the feedback.

Did you find this page helpful?