Forum Academy Marketplace Showcase Pricing Features

Using the AWS S3 storage

Hi All

Can anyone point me in the right direction as to how to upload files to Bubble’s AWS S3 storage please?

Many thanks

As far as I understand. When you add the file up-loader or image up-loader element. All files uploaded via them automatically stores on Amazon S3. The file link is automatically generated in the element options.

Do you have something specific in mind?

Thanks for the quick reply. Yes, specifically I’d like to use the bulk action on a dataset (under the data tab) to run a workflow which grabs the filepath and uploads the image file from a URL (currently on another server) to Bubble’s AWS S3 storage. Therefore I can’t use the file up-loader or image up-loader element. I am building an image library.

So I think what you need to do is add :saved in s3 when you are storing the file. So instead of saving the link to the external file it will store on s3 and save the link to that.

3 Likes

Thanks. Is there any documentation to this anywhere?

If you search for s3 in Bubble reference you will find a short description.

I confirm @NigelG suggestion. I’m doing it like this in my app. When the image comes from a url, you have to specify “saved in S3”, if the image comes from the image uploader it’s not necessary. Bear in mind that if you try to save an image from the image uploader using the “saved in S3”, you app will not work, and the image will not be saved.

Thanks but which ‘action’ do I use in the workflow builder?

I’ve been trying to implement s3 into my app. Last I tried, using the blockspring/s3 connector, things weren’t working. Are they working now?

That’s an example of a workflow in my app. In my case I get the image from Bing images API, which returns a media url, then I just save the input’s value (the url) to S3

2 Likes

This action gets the image from the url and saves it to S3

Yes, as above. If you had an external URL, you could save it as above to s3.

It needs to be part of a workflow action storing data though.

1 Like

but you can’t use the uploader to upload to your own s3, correct?

Not as far as I know.

2 Likes

I’ve been searching around for a solution to uploading large files. Has anyone made any progress on this?

Saving my life, once again. Thank you! :medal_sports:

@NigelG :saved to s3 works for external links (https://...) as expected, but not for data URIs (data:image/png;base64,ABCD...). Is there a way to use the s3 feature to upload a file to s3? The input is coming from a multiline text input - a data URI with base64 format.

Ooo, gosh. That is a fun one!

So convert base64 image data into an image and store on s3?

Yes exactly!

Also note that I can just save the base64-encoded data itself in bubble, but it-

  1. takes more space
  2. cannot be used for Download a file workflow action (it requires having an actual http(s) URL).
  3. The xyz_object's saved_image's file_name is (obviously) empty in case of a base64 data URI.

I know I can do this by creating a temp file on my own server and then use bubble to upload it to s3, but it would be good if this could be done inside bubble. I am open to any custom-javascript solutions as long as this can be done on client-side.

And of course I guess it wouldn’t be restricted to just images but any file by decoding base64 data.

Im trying to do the same thing too. I create an image in javascript locally - I push to bubble with the javascript to bubble thingy. But now im stuck because I dont know how to save this image to s3. I can view it locally within bubble but I cant save it.