root 4 mesi fa
parent
commit
96f81075bf
1 ha cambiato i file con 4 aggiunte e 5 eliminazioni
  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();
 }