如何使用“img src"引用 Google Cloud Storage 映像(直接链接到图片) [英] How to reference Google Cloud Storage image with "img src" (link direct to the image)

查看:23
本文介绍了如何使用“img src"引用 Google Cloud Storage 映像(直接链接到图片)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说我这样做

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

图片应该在这里

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

(根据 https://developers.google.com/storage/docs/access-public-data) 但它不起作用...

(as per https://developers.google.com/storage/docs/access-public-data) but it doesn't work...

如果你想在bucket"中查看图片并浏览bucket的目录结构,该URL是可以的,但如果你想直接链接到图片,则无用.

That URL is fine if you want to see the image in the "bucket" and browse the bucket's directory structure, but useless if you want to link to the image directly.

我可以去这里 https://console.developers.google.com/m/cloudstorage/b/(bucket-name)/o/google/cube.jpg 直接链接到图片,但是这个/m/cloudstorage/b/" 一个任意位置,还是我总能在那里找到我的图像?还有什么是/o/",这不是我创建的子目录.这些是字母表中的随机字母还是谷歌疯狂的方法还是总是/o/"?

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

简而言之,直接链接到我的 Google Cloud Storage 图片的正确方法是什么?

In short, what's the correct way to directly link to my Google Cloud Storage images?

推荐答案

该 URL 用于开发者的控制台 UI.

That URL is for the developer's console UI.

有关访问点列表,请参阅请求 URI.

See Request URIs for a list of access points.

你可能想要:

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

这篇关于如何使用“img src"引用 Google Cloud Storage 映像(直接链接到图片)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆