直接从浏览器将文件上传到 Azure Blob 存储? [英] Upload file to Azure Blob Storage directly from browser?

查看:39
本文介绍了直接从浏览器将文件上传到 Azure Blob 存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以创建一个 html 表单以允许网络用户将文件直接上传到 azure blob 存储,而无需使用其他服务器作为中介?S3 和 GAW blobstore 都允许这样做,但我找不到对 azure blob 存储的任何支持.

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.

推荐答案

请查看这些将文件直接从浏览器上传到 Blob 存储的博客文章:

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

第二篇文章(由我撰写)使用 HTML 5 File API,因此不适用于所有浏览器.

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

基本思想是为 blob 容器创建一个共享访问签名 (SAS).SAS 应该具有 Write 权限.由于 Windows Azure Blob 存储尚不支持 CORS(Amazon S3 和Google),您需要将 HTML 页面托管在您希望用户上传文件的 blob 存储中.然后就可以使用 jQuery 的 Ajax 功能了.

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.

这篇关于直接从浏览器将文件上传到 Azure Blob 存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆