ProgerXP / FileDrop

Self-contained cross-browser pure JavaScript class for Drag & Drop and AJAX (multi) file upload.
filedropjs.org
The Unlicense
264 stars 61 forks source link

Only 200 OK status is taken into account #54

Open romainbessugesmeusy opened 8 years ago

romainbessugesmeusy commented 8 years ago

Hey all, It seems that filedrop is considering the XHR to be in error if its statusCode is strictly different of 200, which is quite restrictive. Servers might respond with 201 Created or any 2XX status code, and the response should still be correct. Do you want me to submit a pull request ?

https://github.com/ProgerXP/FileDrop/blob/33f85ce84a1df890ab5d9dcf6d105c457b2f18b0/filedrop.js#L2066

moberemk commented 7 years ago

I'm running into this same issue myself, would appreciate it if the system could allow for anything in the 200 range to trigger the done event...

ProgerXP commented 7 years ago

I will add a config for this in the future. For now you can easily work around this by adding an error listener and if the code is in your accepted range - fire done event manually which will trigger normal processing.