0
在使用JavaScript的Windows 8應用程序中,我嘗試使用定義爲in this technique的共享訪問簽名將文件上載到Windows Azure Blob存儲,但我想使用WinRT BackgroundUploader而不是標準存儲客戶端上傳器。當我調用此代碼時,沒有任何反應,並且存儲容器在Windows Azure管理控制檯中爲空。在Windows Azure Blob存儲中使用WinRT BackgroundUploader
有沒有人做過這個?
有沒有人有關於如何將SAS放入BackgroundUploader的serverCredential屬性的建議?所有的
table.insert(upload)
.then(function (e) {
var backgroundTransfer = Windows.Networking.BackgroundTransfer,
uploader = new backgroundTransfer.BackgroundUploader(),
uri = new Windows.Foundation.Uri(upload.sas),
operation,
sasToken = uri.query.substr(1);
uploader.setRequestHeader("Content-Type", file.contentType);
uploader.setRequestHeader("x-ms-blob-type", "BlockBlob");
operation = uploader.createUpload(uri, file);
operation.startAsync().then(function (uploadComplete) {
console.info(uploadComplete);
complete("https://" + uri.host + "/" + upload.containerName + "/" + file.name);
},
function (uploadError) {
console.error(uploadError);
},
function (uploadProgress) {
console.info(uploadProgress);
});