FineUploader / fine-uploader

Multiple file upload plugin with image previews, drag and drop, progress bars. S3 and Azure support, image scaling, form support, chunking, resume, pause, and tons of other features.
https://fineuploader.com
MIT License
8.19k stars 1.87k forks source link

Fineuploader shows Upload failed after successful uploading to s3 #2017

Open truthSeekr opened 6 years ago

truthSeekr commented 6 years ago

Type of issue

Uploader type

Note: Support requests cannot be accepted due to lack of time.

I cant say its my bad code or bug

Bug Report #### Fine Uploader version {example: 5.16.2} #### Browsers where the bug is reproducible Firefox #### Operating systems where the bug is reproducible Linux for sure #### Exact steps required to reproduce the issue For example: 1. upload file chunked way #### All relevant Fine Uploader-related code that you have written 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){ } }});} #### Detailed explanation of the problem The upload is successful, I can see the file in my bucket but fineupload cant manage to verify if this was indeed success. chunk indexes are still marked as in progress so i belive this is a problem Errors Im getting **XML processing error** (`[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:`) **And after last chunk sended** `[Fine Uploader 5.16.2] Complete response status 200, body = http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpgbucketnametest/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg"f785362cd9c53f730b66f5044b0b17b0-2" 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: http://s3.eu-west-2.amazonaws.com/bucketname/test%2F039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpgbucketnametest/039f4dbc-d90f-462e-a426-6420a8cc0ef0.jpg"f785362cd9c53f730b66f5044b0b17b0-2" util.js:236:16 [Fine Uploader 5.16.2] Problem finalizing chunks for file ID 0 - undefined` I think this is related and for me problem persist in newest version https://github.com/FineUploader/fine-uploader/issues/1530 in `function handleCompleteRequestComplete` `bucketEls[0].textContent !== bucket` `bucketEls[0].textContent = bucketname` `bucket = bucketname.s3.eu-west-2.amazonaws.com` so no matter what it will always be false why it doesnt take the bucketname from configuration ? On the begining there was: ` objectProperties: { acl: "private", bucket: qq.bind(function(id) { return qq.s3.util.getBucket(this.getEndpoint(id)); }, this), ` is it on purpose ? why bucket property should be based on endpoint ? Can I change it or I will ruin something ?
rnicholus commented 6 years ago

If you see an issue in the codebase, please open up a PR with your proposed fix. Thanks.

truthSeekr commented 6 years ago

Sorry, i just found it but my tries to fix end on dirty bucket name pasted in complete multiupload function. I tries coupe of variation but with no success. Im not that experienced

pt., 29 cze 2018, 04:27 użytkownik Ray Nicholus notifications@github.com napisał:

If you see an issue in the codebase, please open up a PR with your proposed fix. Thanks.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FineUploader/fine-uploader/issues/2017#issuecomment-401228664, or mute the thread https://github.com/notifications/unsubscribe-auth/AJmP6ZDurTkvWgbeQVZrwWPN0Q_s9Kpuks5uBZCJgaJpZM4U0IZT .