root há 5 meses atrás
pai
commit
96f81075bf
1 ficheiros alterados com 4 adições e 5 exclusões
  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();
 }