0

I am using the API Client Library for PHP in a Laravel (as an api) / AngularJS project that does NOT run on google app engine. I would like to be able to access non public images on a google cloud storage (gcs) bucket via pre signed URL- I have not been able to figure out how to generate pre signed URLs with the php client. Basically I would like to replicate what is shown with Google Storage Tools / Serving Images on google app engine, but without having the script running on google app engine (e.g. on google compute or another cloud server or local development server).

I already have the php client running and I am already using it to generate pre signed upload urls that allow the users to upload images (which was already difficult to figure out). Serving images is not working yet.

Could anyone point me in the right direction? It seems like most functionality that comes with gcs is bound to an app engine environment...

Any help would be very much appreciated.

Thanks and all best, Tobias

tromtv
  • 91
  • 1
  • 9
  • can you share how you did the upload thing? I can't even figure out that yet. – S. A. Malik Mar 04 '16 at 09:39
  • @backTangent Sorry for the late response, I am tackling this at http://stackoverflow.com/questions/30345900/how-to-include-google-app-engine-for-php-in-my-scripts-autoloading/34292927#34292927 – good luck. – tromtv Jun 25 '16 at 15:47

1 Answers1

0

There turns out to be no good way to serve the images, other than using a GAE script to get the google serving URL via CloudStorageTools.getImageServingUrl().

So what I did is I created a api in GAE that allows me to get the URL via CloudStorageTools.getImageServingUrl() and then I cache that URL in my main app. This turns out to be the most effective solution for me, after using my own solutions to cache images via http://flysystem.thephpleague.com integration of google storage into my app as well as the use of diverse other tools to resize and optimise images, which turns out to be slow and expensive at relatively small scale already.

tromtv
  • 91
  • 1
  • 9