Upload file to Azure Blob Storage directly from browser?

user1144313 picture user1144313 · Mar 27, 2013 · Viewed 24k times · Source

Is it possible to create an html form to allow web users to upload files directly to azure blob store without using another server as a intermediary? S3 and GAW blobstore both allow this but I cant find any support for azure blob storage.

Answer

Stopped Contributing picture Stopped Contributing · Mar 28, 2013

Do take a look at these blog posts for uploading files directly from browser to blob storage:

http://coderead.wordpress.com/2012/11/21/uploading-files-directly-to-blob-storage-from-the-browser/

http://gauravmantri.com/2013/02/16/uploading-large-files-in-windows-azure-blob-storage-using-shared-access-signature-html-and-javascript

The 2nd post (written by me) makes use of HTML 5 File API and thus would not work in all browsers.

The basic idea is to create a Shared Access Signature (SAS) for a blob container. The SAS should have Write permission. Since Windows Azure Blob Storage does not support CORS yet (which is supported by both Amazon S3 and Google), you would need to host the HTML page in the blob storage where you want your users to upload the file. Then you can use jQuery's Ajax functionality.