I want to upload video to azure blob storage using its JavaScript client library. I have the SAS token from the API and I have created an instance for blob service like this:
var blobUri = 'https://<account>.blob.core.windows.net/';
vm.sasTOken = "?sv=2016-05-31&sr=c&sig=abcdefghhi&st=2017-10-12T07%3A10%3A05Z&se=2017-10-12T11%3A10%3A05Z&sp=rl"
var blobService = AzureStorage.createBlobServiceWithSas(blobUri, vm.sasToken);
I have tried to upload a video with this service
speedSummary = blobService.createBlockBlobFromBrowserFile('containerName', vm.file.name, vm.file, { blockSize: customBlockSize}, function (error, result, response) {
if (error) {
console.log(error);
} else {
console.log('success');
}
});
I don't know where to pass the Authorization Headers that why its giving me error in console.
403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.)
Write
permission. From the SAS token you shared, it seems you only includedRead
andList
permission. Please create a SAS token withWrite
permission and try again. - Gaurav MantricontainerName
you are passing increateBlockBlobFromBrowserFile
function and 3) value forvm
variable that you're getting back from your API. You can replace the actual signature value in your SAS token with a dummy string. - Gaurav Mantri