Download as PDF-File (Data from external API CALL)

Hi,

i make an external API Call, which responses with an PDF File. How can i Download and Save this PDF File. It should be a Download for the Browser.

I can´t find a widget which provides a “Download File” functionality.

can someone give me a tip?

The Return Header is:

{
“date”: “Mon, 03 Apr 2023 14:33:54 GMT”,
“content-type”: “application/pdf”,
“content-disposition”: “attachment; filename=name123.pdf”,
“cf-cache-status”: “DYNAMIC”,
“cf-ray”: “7b2207808c76d5f1-CDG”,
“x-frame-options”: “DENY”,
“cache-control”: “no-store”,
“strict-transport-security”: “max-age=86400; includeSubDomains”,
“x-content-type-options”: “nosniff”,
“x-request-id”: “c74358e1-fa01-4204-a44c-c96289ad4dd5”,
“transfer-encoding”: “chunked”,
“Via”: “1.1 google”,
“Alt-Svc”: “h3=":443"; ma=2592000,h3-29=":443"; ma=2592000”,
“X-APPSMITH-DATATYPE”: “BINARY”
}

and the raw response starts like:

%PDF-1.4
%ÈÉÊË
6 0 obj
<</Type /Page/Parent 3 0 R/Contents 7 0 R/MediaBox [0 0 595.29998779 841.90002441]/Resources<</Font<</FAAABA 10 0 R/FAAABF 15 0 R/FAAACA 20 0 R/FAAACF 25 0 R>>/XObject<</X1 8 0 R>>>>/StructParents 0>>
endobj
7 0 obj
<</Length 30 0 R/Filter /FlateDecode>>stream
xœÝ=i7r›

thx
Franz

Hi,

sorry, i found it.
In the Button Widget under onSuccess → Download → Data to Download = result of API Call.

I was too stupid to see that !
But if someone should also look for that :slight_smile:

kind regards
Franz