Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adequately react to non-existent upload url and upload error in general.

  • Loading branch information...
commit 855c261392a7ae948d8ee9b18d360537683c80f5 1 parent 1d97fb6
@jayarjo jayarjo authored
Showing with 16 additions and 1 deletion.
  1. +1 −1  src/moxie
  2. +15 −0 src/plupload.js
2  src/moxie
@@ -1 +1 @@
-Subproject commit ceed83752267919d5f6ed5fe94b1c73a1decf12a
+Subproject commit 27204a10d7f21dbe6dd1be4650fef28895320711
View
15 src/plupload.js
@@ -1144,6 +1144,19 @@ plupload.Uploader = function(settings) {
}
xhr.onload = function() {
+ // check if upload made itself through
+ if (xhr.status >= 400) {
+ file.loaded = offset; // reset all progress
+
+ up.trigger('Error', {
+ code : plupload.HTTP_ERROR,
+ message : plupload.translate('HTTP Error.'),
+ file : file,
+ status : xhr.status
+ });
+ return;
+ }
+
// Handle chunk response
if (curChunkSize < blob.size) {
if (chunkBlob.isDetached()) { // Dispose if standalone chunk
@@ -1184,6 +1197,8 @@ plupload.Uploader = function(settings) {
};
xhr.onerror = function() {
+ file.loaded = offset; // reset all progress
+
up.trigger('Error', {
code : plupload.HTTP_ERROR,
message : plupload.translate('HTTP Error.'),
Please sign in to comment.
Something went wrong with that request. Please try again.