Upload file to Azure Blob Storage directly from browser?

后端 未结 5 844
北海茫月
北海茫月 2020-12-08 10:43

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 b

5条回答
  •  一整个雨季
    2020-12-08 11:12

    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.

提交回复
热议问题