Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload file to Azure Blob Storage directly from browser?

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.

like image 385
user1144313 Avatar asked Mar 27 '13 22:03

user1144313


People also ask

How do I upload a file to Azure Blob storage from the browser?

In the web app, select Select and upload files. Browse to your test file, and then select Open. The status indicates that the file was uploaded, and the file list was retrieved. In the Azure portal, select the name of the new container that you created earlier.

How do I upload to Azure Blob Storage from my frontend?

Run project locally to verify connection to Storage account. Your SAS token and storage account name are set in the src/azure-storage-blob. ts file, so you are ready to run the application. Select an image from the images folder to upload then select the Upload!

How do I transfer files to BLOB storage?

Click on the ... to the right of the Files box, select one or multiple files to upload from the file system and click Upload to begin uploading the files. To download data, selecting the blob in the corresponding container to download and click Download.


1 Answers

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.

like image 140
Gaurav Mantri Avatar answered Sep 30 '22 20:09

Gaurav Mantri