![](/img/trans.png)
[英]error while uploading file to IBM cloud object storage using python
[英]How to get a direct URL to a file on IBM Cloud Object Storage
所以,我在 IBM 的雲 Object 存儲上有一個存儲桶。 在這個桶中,我有一個名為“test.png”的文件。
我需要的是一個 URL,我可以用它來直接訪問這個文件。 我可以在瀏覽器上寫一個 URL,圖像將在我的瀏覽器上打開。
我到處搜索,除了這種格式的“ObjectSQL URL”之外找不到任何東西:
cos://{區域}/{存儲桶}/{文件}
Presuming that the bucket has public access enabled , the URL is just https://{endpoint}/{bucket}/{object}
(or https://{bucket}.{endpoint}/{object}
. So if your image is in a US Cross-Region bucket called 'images', the URL would be https://s3.us.cloud-object-storage.appdomain.cloud/images/test.png
(or https://images.s3.us.cloud-object-storage.appdomain.cloud/test.png
),它會在瀏覽器中呈現(大多數時候,不同的瀏覽器有不同的行為)。
現在,假設有一個公共訪問存儲桶,其中存儲桶中的所有數據都可以公開訪問。 如果您只想在有限的時間內使單個 object 可訪問,則需要使用 HMAC 憑據創建一個預簽名的 URL 。
我知道這是一個老問題,但我一直回到它以供參考,並且必須找出鏈接的 rest。
URL的結構為:
https://s3.{region}.cloud-object-storage.appdomain.cloud/{bucket-name}/{filename-with-extension}
該區域可以在 object 的詳細信息中找到,在 Object SQL URL 中,如您所述,或在下面的列表中:
regions:
cross-regional: [ap,eu,us]
regional: [au-syd, br-sao, ca-tor, eu-de, eu-gb, jp-osa, jp-tok, us-east, us-south]
single-site: [ams03, hkg02, sng01, mil01, sjc04, sao01, seo01, tor01]
參考資料: https://www.ibm.com/docs/en/aspera-on-cloud?topic=basics-cloud-platforms-regions-supported
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.