Bluemix Object Storage Service中对象的公共URL [英] Public URLs For Objects In Bluemix Object Storage Service

查看:81
本文介绍了Bluemix Object Storage Service中对象的公共URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一些照片上传到Bluemix Object Storage服务,然后在Web应用程序中显示它们.现在,对对象存储容器中照片的GET请求需要and auth令牌.有什么方法可以为该对象创建一个公共URL,而该对象不需要GET请求的身份验证令牌?

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?

我看到有一个为对象创建临时URL的选项,但是我不希望该URL是临时的,我希望它可以永久存在.创建长期存在的临时URL的唯一选择是吗?

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?

推荐答案

执行此操作的正确方法是修改容器ACL.您当前无法通过Bluemix UI执行此操作,但是可以使用 Swift REST API .例如,要更改容器ACL,以便任何人都可以读取容器中的对象,可以发出以下PUT请求.

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:*"

这篇关于Bluemix Object Storage Service中对象的公共URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆