How to save an image from an external URL into the Bubble database

Hello, I have an api integration where external api gives an image URL which is temporary on their server so I would like to have them saved into bubble database permanently. How do I do this? At the moment its only saving the URL and not the file, so after 2 days these urls saved on my db become empty.

2 Likes

User SavetoS3 while saving the external image path to the database table. it will directly save the external file url to S3.

Not sure I understood, could you please explain again or maybe paste images from the workflow? when I do save to s3, all it does is save the same url and not the file.


Hope this will help you.

5 Likes

I did the same and yet, the change made has the same image source which is the temporary link from the api of external image. Also, in your case, its inputA’s value, here probably you have input a dynamic image url. Maybe it works in this use case but in mine, im not uploading an image via image uploader, I have a workflow where the image is received from Api using Action and then the url from response data is saved to a thing, I then did a make changes to the same thing with added :saved to s3. Didnt seem to work.

1 Like

Yes, i understand your case. This was work for API too. Already i have workedout.
Please share your app editor.
i will let you know.

Thanks a ton, it worked :slight_smile:

How did you do it? I did the same steps as you, creating a file and afterwards using the saved to s3 function. It didn’t work. Can you help me out?

2 Likes

So in my case, I have an API that gives me back images, so first step I do is CREATE

image

In this, I simply save the URL

image

next step is I make changes to Result of step 1 which is CREATE

image

Here I add saved to s3.

I hope the images make it easy for you to understand.

Feel free to ask if you still have any doubt.

Cheers :slight_smile:

5 Likes

Thanks for your answer. However, it doesn’t work for me. So I have the same setup as you

But the URL stays the same. The first image is the URL where the image is saved. The second image, the URL of “afbeelding” should be an s3 URL i guess with my setup, but it isn’t.

Screenshot 2020-05-16 at 14.47.59

Thanks in advance!

1 Like

No, dont check it here, this is the same mistake I did too, go to your database where this image is saved and click the see button, this will open the image in a new tab and then check the link in the url of this tab, if it has s3bucket in it then its successful.

image

This is exactly where you should check the link and is technically the actual link to your image that is saved.

When i check it in my database it remains the old url, not the s3 bucket. Strange…

1 Like

did you see this link on the new tab that gets opened when you click the image ?

image

in this step maybe also add image B’svalue’s url and try

Yes, still the old url.

Not sure why this is happening. I checked my workflows and there is nothing different im doing, its working for me.

1 Like

Is it possible to specify a header such as an authorization Bearer token for the URL? For my use case, the external URL with the content requires a Bearer token: 'Authorization: Bearer ’

If this is not possible, is there an alternative method for saving an image from an external URL into the Bubble database which would allow specifying such a header?

In my case, it worked.
I dit a GET a request with the API Plugin to the image url
Notice : I used an API workflow only because I needed to do this on a list of images. For a single image, this could have been done in front


Amazing, got me over the hump on a problem, thank you!

Awesome. This worked perfectly.