[Openstack] can I access the data stored on swift through a web browser

John Dickinson me at not.mn
Sat Dec 14 06:33:33 UTC 2013


Yes, you can absolutely do this.

As mentioned in another reply, Swift's API is built on HTTP, so it works natively with web browsers.

There are a couple of ways to read data stored in Swift via a web browser.

1) For public content:
If you've marked a container as public (ie X-Container-Read set to ".r*"), then you can access any object in that container directly without worrying about auth tokens. eg `curl -i http://swift.example.com/v1/AUTH_test/images/cat.jpg`

2) For non-public content:
You can generate a tempurl to make a signed URL that has limited-time access to read a particular object. See http://docs.openstack.org/developer/swift/misc.html#module-swift.common.middleware.tempurl for more info.



There are also a couple of different ways to use a web browser (or app running in a browser) to write content into Swift.

1) Using a tempurl, you can give time-limted access to write content into a cluster, as mentioned above

2) Submit to Swift using an HTML form:
You can send a form post to a Swift cluster as documented at http://docs.openstack.org/developer/swift/misc.html#module-swift.common.middleware.formpost


In all cases, tying a Swift cluster to a web application may require you make use of the CORS standard to get around browser-based security sandboxes. Swift fully supports the CORS standard, as documented at http://docs.openstack.org/api/openstack-object-storage/1.0/content/assigning-cors-headers-to-requests.html. To read about the CORS spec see http://www.w3.org/TR/cors/.

These features make Swift a perfect pair with applications that demand support for high-concurrency access to massive storage pools (like web and mobile apps).

Hope that info helps!


--John






On Dec 13, 2013, at 11:54 AM, pragya jain <prag_2648 at yahoo.co.in> wrote:

> hello,
> I installed swift on my machine. 
> I store some data on it using swift command line. 
> Now, I want to know: 
> can I access the data stored on swift through a web browser?
> ----------
> 
> Pragya Jain
> _______________________________________________
> Mailing list: http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
> Post to     : openstack at lists.openstack.org
> Unsubscribe : http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20131213/1b2826f8/attachment.sig>


More information about the Openstack mailing list