Monday, March 6, 2017

how to access s3 private images visible on browser using php

I have thousands of images to display on browser form private bucket of S3. What is best way to get these private file on browser.

In order to get private image from s3 I have found multiple solutions listed below:

  1. Make the files public. (can't use this as per requirment)
  2. Generate pre-signed urls for files.
  3. Pulls the image via the API from S3, caches it and serves.
  4. By changing bucket policy.

Currently I am using signed url to get images but for every image I have to generate signed url. it will take lot of processing time.

My Question is, what is best way? And how to achieve this?



via Prashant Shukla

Advertisement