Store pdf from url to bubble

I am using pdfgeneratorapi (and their plugin) to create pdf documents. Creation process works fine and I can get two types of responses. Either a pdf url (valid for 30 days) or base64 encoded file. I need to store the pdf in bubble database but so far I have not succeeded in finding a solution. I need the pdf as a file so that users can view the pdf later (e.g. link to external website pointing file stored is s3).

I have two options here.

  1. How to extract the pdf from URL and store it in bubble?
  2. In case base64 is returned how can I convert the base64 to a pdf file

Appreciate if anyone can share info on how to do this.
Br -Juhani

Have you tried setting the response type as File and seeing if it auto downloads from the URL?

When you are testing/initializing the call and you get the response back you pick “file” as the datatype for the URL parameter

HI, Thanks for responding. The only options I have for Output type are URL or Base64. Using URL works fine to display the pdf but the url is valid for only 30 days.

The base64 gives the encoded result the can not be displayed.

I see, I thought you were just calling it with the API Connector.

If you do Base64 and install Bubble Back End Utilities Plugin | Bubble

Then this action would be useful for you:

Otherwise a vanilla way this could be done is you use the API Connector and just not use the plugin, or use the plugin but setup an API to call your own app and send itself the URL and save that as a file :joy:

Hi, many thanks for the advice. I try and see if it works,
Thanks again

Another option - built into Bubble … take a text URL → use as a file → saved to S3

view the workflow here https://bubble.io/page?type=page&name=save_a_file_from_a_url&id=knowcode-tech&tab=tabs-2

One of those amazing Bubble things you discover just by clicking around … :slight_smile:

6 Likes

Yep that’ll work it seems, never knew about that. Searching on the forum for “Download in backend” and no one knows about that :joy:

1 Like

Hi, Thanks this works nicely. Bubble has a lot of features you can find by experimenting. This is really cool.

1 Like