Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Public URLs For Objects In Bluemix Object Storage Service

I would like to upload a number of photos to the Bluemix Object Storage service and then display them in a web app. Right now a GET request to the photo in the object storage container requires and auth token. Is there any way I can create a public URL to the object that would not require an auth token for a GET request?

I see there is an option of creating temporary URLs to objects but I don't want the URL to be temporary I want it to live forever. Is the only option to create a long lived temporary URL?

like image 494
Ryan Baxter Avatar asked Feb 07 '23 08:02

Ryan Baxter


2 Answers

The correct way to do this is to modify the container ACL. You cannot do this via the Bluemix UI currently but you can using the Swift REST API. For example, to change the container ACL so anyone can read objects in the container you can issue the following PUT request.

curl -X PUT "https://dal.objectstorage.open.softlayer.com/v1/AUTH_123/mycontainer" \
    -H "X-Auth-Token: token123" \
    -H "X-Container-Read: .r:*"
like image 192
Ryan Baxter Avatar answered Mar 02 '23 00:03

Ryan Baxter


I know this is a old post but with the help of Ryan Baxter and Object storage documentation in IBM I could resolve the Issue Finally these too commands saved the day

First use swift and change access control of container

swift post container-name --read-acl ".r:*,.rlistings"

Next Using Curl Configure Container to a particular Url for accessing Files

curl -X GET " https://<access point>/<version>/AUTH_projectID/container-name" -H "X-Auth-Token:<auth token>"     -H "X-Container-Read: .r:*,.rlistings"

And also very grateful for the help provided by Alex da Silva

like image 43
briantaurostack7 Avatar answered Mar 01 '23 23:03

briantaurostack7