如何直接 URL 访问 IBM Cloud Object Storage 上的文件

How to get a direct URL to a file on IBM Cloud Object Storage

所以,我在 IBM 的 Cloud Object Storage 上有一个存储桶。 在这个存储桶中,我有一个名为 'test.png'.

的文件

我需要的是 URL 我可以用来直接访问此文件。一个 URL,我可以在浏览器上写,图像将在我的浏览器上打开。

我到处搜索,除了 "ObjectSQL URL" 这种格式之外找不到任何东西:

cos://{区域}/{存储桶}/{文件}

假设 bucket has public access enabled,URL 只是 https://{endpoint}/{bucket}/{object}(或 https://{bucket}.{endpoint}/{object})。因此,如果您的图像位于名为 'images',URL 将是 https://s3.us.cloud-object-storage.appdomain.cloud/images/test.png(或 https://images.s3.us.cloud-object-storage.appdomain.cloud/test.png),它会在浏览器中呈现(大多数情况下,不同的浏览器有不同的行为)。

现在,假设有一个 public 访问存储桶,其中存储桶中的 所有 数据都 public 可以访问。如果您只想在有限的时间内访问单个对象,则需要 create a presigned URL 使用 HMAC 凭据。