1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 07:27:04 +00:00

[fileupload] fixed bug for 'upload fail', handled 'fail' like '413'

This commit is contained in:
llj
2014-03-28 15:30:42 +08:00
parent 1022f996d6
commit fcb4f2fedf

View File

@@ -181,6 +181,7 @@
},
// Callback for failed (abort or error) uploads:
fail: function (e, data) {
$('.saving-tip', $(this)).addClass('hide');
var that = $(this).data('fileupload'),
template;
that._adjustMaxNumberOfFiles(data.files.length);
@@ -190,7 +191,11 @@
var file = data.files[index];
var r_error;
if (data.jqXHR.responseText) {
r_error = $.parseJSON(data.jqXHR.responseText).error;
try { // not all responseText can be parsed as JSON, e.g, '413' returns a HTML str.
r_error = $.parseJSON(data.jqXHR.responseText).error;
} catch(e) {
r_error = '';
}
}
if (data.dataType == 'iframe json') { // for browsers which use iframe
data.errorThrown = '';