root 5 月之前
父節點
當前提交
96f81075bf
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      js/Common/awsupload.js

+ 4 - 5
js/Common/awsupload.js

@@ -37,12 +37,9 @@ async function uploadPart(file, keyname, uploadid, pn, start, end) {
     var params = {
         Bucket: bucketname,
         Key: keyname,
-        ContentType: file.type,
         PartNumber: pn,
         UploadId: uploadid,
-        Body: file.slice(start, end),
-        "Access-Control-Allow-Credentials": "*",
-        ACL: "public-read",
+        Body: file.slice(start, end)
     };
     const result = await bucket.uploadPart(params).promise();
     return { ETag: result.ETag, PartNumber: pn };
@@ -54,7 +51,9 @@ async function completeMultipartUpload(parts, keyname) {
         Bucket: bucketname,
         Key: keyname,
         MultipartUpload: { Parts: parts },
-        UploadId: uploadid
+        UploadId: uploadid,
+        "Access-Control-Allow-Credentials": "*",
+        ACL: "public-read"
     };
     return await bucket.completeMultipartUpload(params).promise();
 }