如何获取指向IBM Cloud Object Storage上文件的直接URL [英] How to get a direct URL to a file on IBM Cloud Object Storage
问题描述
因此,我对IBM的Cloud Object Storage十分满意. 在这个存储桶中,我有一个名为"test.png"的文件.
So, I have a bucket on IBM's Cloud Object Storage. In this bucket I have an file named 'test.png'.
我需要的是一个URL,我可以使用它直接访问此文件.我只能在浏览器上写一个URL,然后图像就会在我的浏览器上打开.
What I need is an URL i can use to access this file directly. An URL that I can just write on browser and the image will open on my browser.
我搜索了所有地方,但找不到以下格式的"ObjectSQL URL"以外的任何内容:
I've searched everywhere and could not find anything except for a "ObjectSQL URL" in this format:
cos://{Region}/{Bucket}/{File}
cos://{Region}/{Bucket}/{File}
推荐答案
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
) and it would render in a browser (most of the time, different browsers have different behaviors).
现在,假设有一个公共访问存储桶,其中存储桶中的所有数据可以公共访问.如果只想在有限的时间内访问单个对象,则需要
Now, that assumes a public access bucket, where all data in the bucket is publicly accessible. If you want to just make a single object accessible for a limited time, you'd need to create a presigned URL using HMAC credentials.
这篇关于如何获取指向IBM Cloud Object Storage上文件的直接URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!