how to reproduce:
at this point, the error-event will not fire, but the file-upload-complete even will fire, saying the response is an empty-string. this is wrong. the error-event should fire and not this one.
for example, the flash-module does it that way (errorevent-fired).
it seems the problem is here in the source code:
as you see, to decide whether we had an error or not, the code checks if the status is >=400.
when the above-mentioned connection error happens, the status=0.
(based on my test. the spec says the same: http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute)
a quick fix would be to handle the status=0 case as an error too, but i'm not sure what kind of error to report... should plupload.HTTP_ERROR reported with status-code 0? or maybe IO_ERROR?
also, based on what's written here:
maybe it would be better to go for the 'error' xhr-event?
i will try to create a patch later, but i would need to know first which way should this be handled?
I asked about this same problem on the discussion forum a few months ago as well, so I can confirm the problems exists:
Same issue on latest Chrome + html5 runtime. I was surprised, when my custom UI started updating upload progress quickly, when I switch off internet cable.
Reporting error in case connection gets lost during upload with XHR u…
…ploader instead of assuming successful upload. See #240 and #499.