Create PDF file from external API in Xano

Hi all,

I am working with an external API that responds with pdf data. I am encoding this pdf data using the base64_encode filter. The encoded data saves fine to a database column. However, what I am having trouble with is generating the PDF file in Xano. I have tried to use the create file resource function using a base64_decode filter but the file doesn't get created. I have also tried to create a HTTP custom header to download the file but it downloads an empty file. It seems to be saving the file data as the file name. I'm assuming this decode filter just decodes it as text?

I believe the base64 encoded data is working as intended because when I use a base64 to PDF converter, the file can be generated successfully. I have tested it through this website here: https://base64.guru/converter/decode/pdf

It seems as if I am doing something wrong in the create file resource function or Xano does not have the ability to decode to PDF. Is someone able to provide me with some help? My intention is to create the PDF file in Xano, store it in the files and have a database column link to it.

Thank you. :)

Working with APIs
12 replies