# Store pdf from url to bubble

**URL:** <https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263>\
**Category:** Plugins\
**Created:** [December 31, 2022, 9:21am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263 "2022-12-31T09:21:50Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gofastrapid](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gofastrapid/32/142353_2.png) [@gofastrapid](https://forum.bubble.io/u/gofastrapid)\
**Post date:** [December 31, 2022, 9:21am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/1 "2022-12-31T09:21:50Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [December 31, 2022, 9:33am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/2 "2022-12-31T09:33:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [December 31, 2022, 9:41am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/3 "2022-12-31T09:41:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gofastrapid](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gofastrapid/32/142353_2.png) [@gofastrapid](https://forum.bubble.io/u/gofastrapid)\
**Post date:** [December 31, 2022, 9:44am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/4 "2022-12-31T09:44:22Z")

</div>

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.

 ![Näyttökuva 2022-12-31 kello 11.38.00](https://us1.discourse-cdn.com/bubble/original/3X/8/3/831e6ae7caa0f685dba62138f765f509c2191a09.png)

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [December 31, 2022, 9:54am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/5 "2022-12-31T09:54:16Z")

</div>

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](https://bubble.io/plugin/bubble-back-end-utilities-1620673970192x112120583001473020)

Then this action would be useful for you:

 ![Screenshot_5](https://us1.discourse-cdn.com/bubble/original/3X/2/d/2dcdde9f608fa9cf6d0da90abd2971adf58787bd.jpeg)

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 😂

---

<div class="post-metadata">

**Author:** ![gofastrapid](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gofastrapid/32/142353_2.png) [@gofastrapid](https://forum.bubble.io/u/gofastrapid)\
**Post date:** [December 31, 2022, 10:04am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/6 "2022-12-31T10:04:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lindsay\_knowcode](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lindsay_knowcode/32/92967_2.png) [@lindsay\_knowcode](https://forum.bubble.io/u/lindsay_knowcode)\
**Post date:** [December 31, 2022, 11:24am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/7 "2022-12-31T11:24:33Z")

</div>

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](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 … 🙂

 ![Screenshot 2022-12-31 at 11.20.15](https://us1.discourse-cdn.com/bubble/original/3X/3/0/3086bd7c0554d7ddebd1e5fec6224b31c0c51423.png)

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [December 31, 2022, 11:25am UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/8 "2022-12-31T11:25:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![gofastrapid](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gofastrapid/32/142353_2.png) [@gofastrapid](https://forum.bubble.io/u/gofastrapid)\
**Post date:** [December 31, 2022, 12:12pm UTC](https://forum.bubble.io/t/store-pdf-from-url-to-bubble/239263/9 "2022-12-31T12:12:44Z")

</div>

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