问题
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