我将fineuploader用于AWS s3,并在服务器上生成签名,分块一致性:已启用。该文件正在上传,甚至显示在我的存储桶中,但完成该过程无效。 Fineploader仍然显示错误
uploader.js
var s3Uploader = new qq.s3.FineUploader({
element: document.getElementById("uploader"),
autoUpload: false,
debug: true,
objectProperies: {
host: "http://s3.eu-west-2.amazonaws.com",
acl: 'private',
// key: function(fileId) {
// return 'folder/within/bucket/' + this.getUuid(fileId);
// },
region: "eu-west-2"
},
request: {
accessKey: "access",
endpoint: "http://s3.eu-west-2.amazonaws.com/xxx/test",
customHeaders: {
'Access-Control-Allow-Origin': "http://localhost:3000",
'Access-Control-Allow-Credentials': "true"
}
},
signature: {
endpoint: "/get_signature",
version: 4,
host: "http://s3.eu-west-2.amazonaws.com",
region: "eu-west-2",
customHeaders: {
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
// 'Authorization': AWS4-HMAC-SHA256 Credential=access/20150830/us-east-1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7
}
},
uploadSuccess: {
endpoint: "/dashboard"
},
iframeSupport: {
localBlankPagePath: "success.html"
},
chunking: {
enabled: true,
concurrent: {
enabled: true
}
},
resume: {
enabled: true
},
retry: {
enableAuto: true,
showButton: true
},
validation: {
itemLimit: 1,
// sizeLimit: 524243,//1048576, //1mb
acceptFiles: ["image/*"]
// allowedExtension:
},
cors: {
//all requests are expected to be cross-domain requests
expected: true,
//if you want cookies to be sent along with the request
sendCredentials: true
},
callbacks: {
onSubmit: function(id, filename){
}
}
});
沿着fineuploader尝试检查块是否在服务器上但失败的方法
[Fine Uploader 5.16.2] File ID 0 has no more chunks to send and these chunk indexes are still marked as in-progress: [1,4]
util.js:236:16
XML processing error: active item not found
Obszar: http://s3.eu-west-2.amazonaws.com/xxx/test/8097845f-238b-4f7f-a230-e414febac146.jpg?partNumber=4&uploadId=hvy67lKG.0i5iOfus3oYbMg7l9cYxzSlHIL2gpRlkt8tk1LKhPEGKTJbg1laGHjpl3u.oHDRQPfv2_GYE3mprNqwjdEEU_wxkrzihbPpyJjW5gL4smyJhUHnuGBblzjH
Numer wiersza: 1, kolumna 1:
即使文件在服务器上,也可以得到结果
[Fine Uploader 5.16.2] Complete response status 200, body = <?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Location>http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Location><Bucket>bucketname</Bucket><Key>test/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Key><ETag>"f785362cd9c53f730b66f5044b0b17b0-2"</ETag></CompleteMultipartUploadResult>
util.js:236:16
[Fine Uploader 5.16.2] Wrong bucket in response to Complete Multipart Upload request for 0.
util.js:241:20
[Fine Uploader 5.16.2] Received response status 200 with body: <?xml version="1.0" encoding="UTF-8"?>
<CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"><Location>http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Location><Bucket>bucketname</Bucket><Key>test/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg</Key><ETag>"f785362cd9c53f730b66f5044b0b17b0-2"</ETag></CompleteMultipartUploadResult>
util.js:236:16
[Fine Uploader 5.16.2] Problem finalizing chunks for file ID 0 - undefined
任何帮助点都值得赞赏