How to link to a Google Cloud Storage image using "img src" (link directly to the image)

Let's say i do it

./gsutil cp /home/blah/blah/post-images/google/cube.jpg gs://(bucket-name)/google/cube.jpg

The image should be here

<img src="https://console.developers.google.com/storage/(bucket-name)/google/cube.jpg

(according to https://developers.google.com/storage/docs/access-public-data ), but this does not work ...

This URL is suitable if you want to see the image in the "bucket" and view the directory structure, but it is useless if you want to directly link the image.

I can go here https://console.developers.google.com/m/cloudstorage/b/(bucket-name)/o/google/cube.jpg to directly link to the image, BUT it's "/ m / cloudstorage / b / "arbitrary location, or can I always find my images there? Also that "/ o /" is not a subdirectory that I created. Are these random letters of the alphabet or is there a google madness method or is it always "/ o /"?

In short, what is the right way to directly link to my Google Cloud Storage images?

+4
source share
1 answer

This URL is for the developer console interface.

See Request URIs for a list of access points.

You probably want:

https://storage.googleapis.com/bucketname/google/cube.jpg
+7

Source: https://habr.com/ru/post/1539371/