cinely / mule-uploader

Stubborn HTML5 Amazon S3 uploader
http://mule-uploader.com/
MIT License
223 stars 43 forks source link

check_already_uploaded seems not work properly #55

Open sinorga opened 9 years ago

sinorga commented 9 years ago

Hi, I would like to know how mule-uploader handle the file have been uploaded completely when user select the same file again.

I saw the behavior on sample site (http://mule-uploader.com/) is:

  1. Send request for singing key to backend
  2. Send request to S3 and it response error NoSuchUpload, The specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.
  3. Send request for singing key with force parameter to backend.
  4. Start a new uploading (it means s3 will have two same files)

Then I tried to remove the force parameter at my environment to see if it will handle the uploaded file checking, I got errors. The flow as below:

  1. Send request for singing key to backend
  2. Send request to S3 and it response error NoSuchUpload, The specified upload does not exist. The upload ID may be invalid, or the upload may have been aborted or completed.
  3. Send request for singing key parameter to backend.
  4. Two OPTION requests to S3 and response 200 ok
  5. Two PUT requests to S3 and response 502 or 404
  6. Show exception on console, Uncaught TypeError: Cannot read property 'region' of undefined line: 759 (it in check_already_uploaded function)

So, what the purpose of check_already_uploaded? How does it check the file uploaded? is this a issue or just un-support this kind of scenario?

And I got the same exception when uploading timeout, it seems the error_callback not work properly.

Its network har file: https://dl.dropboxusercontent.com/u/52456752/localhost.har its console log: https://dl.dropboxusercontent.com/u/52456752/check_already_uploaded_error.log

ElderBrE commented 8 years ago

Also seen this behaviour. Even if the upload finishes and there is some error, throws back an error on line 1020 "error_callback function undefined" or something like that. I don't think that's working properly.