Skip to content

html5-mode: connection errors are not reported #240

gabor opened this Issue Mar 10, 2011 · 2 comments

3 participants

gabor commented Mar 10, 2011

how to reproduce:

  • using the html5 module
  • create a simple file-upload webpage
  • load the webpage
  • turn off the webserver
  • try to upload a file

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:

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?

MCF commented Mar 10, 2011

I asked about this same problem on the discussion forum a few months ago as well, so I can confirm the problems exists:

dtmax commented Aug 7, 2012

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.

@AugustusKling AugustusKling added a commit to AugustusKling/plupload that referenced this issue May 16, 2013
@AugustusKling AugustusKling Reporting error in case connection gets lost during upload with XHR u…
…ploader instead of assuming successful upload. See #240 and #499.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.