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

青春壹個敷衍的年華 提交于 2020-06-26 14:30:11

问题


So, I have a bucket on IBM's Cloud Object Storage. In this bucket I have an file named 'test.png'.

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.

I've searched everywhere and could not find anything except for a "ObjectSQL URL" in this format:

cos://{Region}/{Bucket}/{File}


回答1:


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.



来源:https://stackoverflow.com/questions/58615583/how-to-get-a-direct-url-to-a-file-on-ibm-cloud-object-storage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!