Hello Suresh. The image service's get_serving_url is indeed the recommended method of serving images from Google Cloud Storage using your application.
As for the InvalidBlobKeyError, this is most likely caused by the double-slashes in '/gs//silver...'. The filename should be of the form "/gs/bucket_name/object_name". [1] <https://cloud.google.com/appengine/docs/standard/go/blobstore/reference#BlobKeyForFile> On Monday, September 18, 2017 at 2:14:57 PM UTC-4, Suresh Jeevanandam wrote: > > I am trying to serve images stored in cloud storage from appengine python > Standard environment. > > I found the images.get_serving_url() to be the simplest way to do this after > some research. But, unfortunately it did not work when deployed. > > > Here is the error message. Am I doing something wrong in this call. Or this > method is not the correct one for this use. Is there any other simpler way to > achieve this? > > > return images.get_serving_url(None, filename='/gs/' + self.get_filename()) > File > "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/images/__init__.py", > line 1868, in get_serving_url > return rpc.get_result() > File > "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/apiproxy_stub_map.py", > line 613, in get_result > return self.__get_result_hook(self) > File > "/base/data/home/runtimes/python27_experiment/python27_lib/versions/1/google/appengine/api/images/__init__.py", > line 1972, in get_serving_url_hook > raise _ToImagesError(e, readable_blob_key) > InvalidBlobKeyError: InvalidBlobKeyError: > u'/gs//silver-device-834.appspot.com/previews/63e0609e-7147-496d-9418-c44bdb5b0456.jpg' > > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/c1cf89b9-777f-40eb-8ef7-b12364b2668b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
