Ask Your Question

how can I see the full URL of files saved in Swift?

asked 2015-04-19 20:20:16 -0500

akhildev gravatar image

updated 2015-04-21 10:23:10 -0500

smaffulli gravatar image

I am planning to use openstack-swift as an image repository. My use case includes a. uploading images using the http form upload. b. Previewing of the uploaded images.

I am looking for a way by which i can give a direct URL to the uploaded image so that the browser can render it.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted

answered 2015-04-20 18:34:18 -0500

torgomatic gravatar image

You can use Swift's tempurl feature for this:

Basically, you hash together the object name, link expiration time, verb (here, "GET"), and an account-level secret and then stick that in a query parameter. That link allows public access until the expiration time.

Hint: If you want a link that's good for basically forever, just make the expiration time really large.

edit flag offensive delete link more

answered 2015-04-21 09:21:55 -0500

I would recommend using a Temp URL as to not expose the direct location of the image if this was going to be external facing. If you do expose the URL then your container you may want to look into securing your container with Swift ACL's. Also ensure the content-type is correct and you should be able to just use the full URL to the object in the tag.

edit flag offensive delete link more

answered 2015-04-20 04:47:28 -0500

uts9 gravatar image

updated 2015-04-20 11:01:58 -0500

smaffulli gravatar image

Create a container and upload your images. While uploading the file you need to specify a name(objname).

URL will be in below format

However in AWS, you can directly access the files by specifying the bucketname.


Not sure whether this is possible with OpenStack.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2015-04-19 20:20:16 -0500

Seen: 192 times

Last updated: Apr 21 '15