0

On Bluemix, I created a Java application using Liberty for Java and the Object Storage Service. I then bound the Java Application and Object Storage Device. I uploaded the images into the container which I created in the Object Storage service. Now I want to access the uploaded images publicly, such as opening the images in a browser directly. I created the URL like the IBM Bluemix documentation said. After I access the URL in browser it shows the following error:

401 Unauthorized

Unauthorized

This server could not verify that you are authorized to access the document you requested.

My sample URL

Is it possible to make the URL public?

BSMP
  • 4,596
  • 8
  • 33
  • 44
Yugesh
  • 4,030
  • 9
  • 57
  • 97

1 Answers1

2

You can create a temporary public URL using the swift command line. First you need to set a key and they create the temporary url. For example:

swift post -m "Temp-URL-Key:yourkey"

swift tempurl GET 3000 /v1/AUTH_90e12a182adf4a32bbd5e34645380244/offermsgs-cateimgs/books.jpg yourkey

The output of the command above will be your temporary public URL and in the example below it will be valid for 3000 seconds.

You can modify Object Storage ACL as well to make all files read only as suggested in the following post:

Public URLs For Objects In Bluemix Object Storage Service

Alex da Silva
  • 4,552
  • 2
  • 17
  • 25
  • Both of these are good suggestions. The container-level ACL will probably be simpler, if there is no requirement for anything in the container to be private. (If there is, that could also be handled by moving private content to a different ACL.) – Holly Cummins Jul 19 '17 at 17:01