upload: Limit total size of files uploaded by a user to 1GB.

Fixes #3884.
This commit is contained in:
Philip Skomorokhov
2017-03-02 13:17:10 +03:00
committed by Tim Abbott
parent 777b7d4cb7
commit 866a7b06b2
7 changed files with 93 additions and 3 deletions

View File

@@ -360,7 +360,12 @@
// Pass any errors to the error option
if (xhr.status < 200 || xhr.status > 299) {
on_error(xhr.statusText, xhr.status);
if (this.responseText.includes("Upload would exceed your maximum quota.")) {
var errorString = "QuotaExceeded";
on_error(errorString, xhr.status);
} else {
on_error(xhr.statusText, xhr.status);
}
}
};