Getting the AWS S3 url for the image saved in the DB

Hi all,

Have a weird issue where the :savedtoS3 url that can be returned for images saved to the database is private and when i visit in another tab it shows an Access Denied XML document.

I don’t have any privacy rules conflicting it.

The use case is that someone saves a Pexels image from the API in our app, it then saves the Pexels URL then I have a workflow to overwrite that url with the Bubble S3 url of the stored file (I need that file location to pass to the Twitter API, but thats another story).

So for example I end up with this:

//s3.amazonaws.com/appforest_uf/<pathhereremovedforsecurity>/pexels-photo-623046.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D650%26w%3D940

However, visiting that (with https:// before) shows an Access Denied.

Any idea why this is and how I can make the image saved publicly visible? @eve

Thanks,
Reece

Is there anything in the “attached to” field when viewing it in the File Manager list?

1 Like

Nope nothing - this was my thought as well because as you know when you upload an image or file with an uploader element, you can specify if its private/attached to anything but when you just save using a standard action like I’m doing to save from the Pexels API Bubble gives you no control over that.

Oh wait, upon closer inspection, that looks like a URL-encoded fragment of the Imgix URL. Delete everything after ”.jpeg” and see if the image comes up. If it does, then you have to re-examine how you’re retrieving the actual AWS S3 URL.

Yep tried that as well haha same Access Denied XML page

Thanks for the continued help

Does the image appear in the File Manager? And if so, does it display when viewed from there?

Yep appears in file manager with the S3 url, if i visit in another tab (same cache) works fine but if i open in an incognito it’s obviously private as it’s access denied.

That’s interesting.

I now understand that the above is not the case. Rather, the URL-encoded query string params are part of the Pexels URL, which I did not realize.

If anything else comes to mind, I’ll let you know.

I tried with a couple Pexels images, and they are both publicly accessible…

https://s3.amazonaws.com/appforest_uf/f1587044233664x246420941575871580/pexels-photo-623046.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D650%26w%3D940

https://s3.amazonaws.com/appforest_uf/f1587045329386x558292466838596900/pexels-photo-3099153.jpeg%3Fauto%3Dcompress%26cs%3Dtinysrgb%26h%3D640%26w%3D959

That said, I seem to recall having encountered what you describe on rare occasion, but I could never reproduce it. If you can reliably reproduce the behavior, I’d definitely suggest submitting a bug report.

1 Like

That’s really weird! And those are URLs of images you’ve saved from Pexels in your Bubble DB?

No idea why all of mine are private then

Correct - saved as Image types.

Me neither. :confused:

But it does seem to indicate that the issue is with AWS permissions and not Bubble, so if the Bubble team can reproduce it, they should be able to resolve it.

how to save the base64 file in s3 and get url in workflow