How to upload image to azure blob using javascript

I think that says it all: how can I upload an image to azure blob using JavaScript for Windows 8 Apps? I can only find examples for C # on the Internet, but nothing for JavaScript.

+4
source share
2 answers

You must have the sas url (shared) for the azure container / blob. then you can use this code snippet with minor modifications to upload the image.

It is highly unlikely that anyone would put the vault primary key in the code of a Windows store application. you can reference this code to create an authorization header for the request. This code does not require a sas url for the container. but an authorization header and primary key are required to create an authorization header.

If the azure container or blob can be made public for recording (I have not tried) - the first solution can be used without a SAS URL.

+2
source

You cannot if javascript makes an asynchronous call back to your application. The Azure BLOB REST API (and all Azure REST APIs) require a request header change to include security credentials. See the explicit answer to your question here .

0
source

All Articles