使用 S3 MultipartUpload 我需要來自 AngularJS $http.put 請求的 ETag 標頭。但是我似乎無法讀取該值。任何幫助表示贊賞。謝謝!
$http({
method: 'PUT',
url: url,
headers: {
'Content-Type': filetype,
'Access-Control-Expose-Headers': 'ETag'
},
data: part
})
.then(function(response) {
let test1 = response.headers("ETag");
let test2 = response.headers();
console.log(test1, test2); // ---> null {content-length: '0'}
})
.catch(function(error) {
console.log(error);
});

uj5u.com熱心網友回復:
發現您需要更新 S3 存盤桶的 CORS:
"ExposeHeaders": [
"ETag",
"x-amz-meta-custom-header"
]
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/452294.html
