Hi, my app is about geographical places. So every place needs an image, and I plan to use AWS S3 to store them and show in the app. I want to figure out a proper way of getting and displaying images for a collection of items.
My basic approach is to start a database table, were I store image names in a bucket and id of the corresponding place. What should I do on a Server part? I see it like this:
Add a S3 storage in Global and connect it to my S3 user account
Get a list of items to work with (let’s say, 20 places)
Using this list, get all the file names from the table, associated with these 20 places
With this file names list, use Sign Download Url to get file paths with tockens
Use this temporary paths to dispaly images at my front end
Is that a correct way to work with S3 images in Wappler?
Simply store the image names in to your table, as long as the images have allow public attribute AWS side this is all you need to retrieve them, simply store the url to the Bucket in one column and the image name in another. Use an id/uid to create the relation and build a query as normal. You may need to adjust your Security AWS side to allow for this, the Bucket security permissions, as the images don’t contain private data can not see a reason to overly secure them from view, just my opinion.
Not if upon upload to S3 you stored the location/filename to your DB, not necessary to include your S3 credentials or permissions. Simple query with a condition set to your id for the ‘place’ to be equal to, etc. Very straight forward.