Make the upload size limit configurable

This commit is contained in:
Steven Silvester 2015-10-21 10:59:17 -05:00
parent a34e0b72a9
commit c8c4b2768c

View File

@ -46,6 +46,7 @@ define([
function(e, d) { that.sessions_loaded(d); }); function(e, d) { that.sessions_loaded(d); });
} }
this.selected = []; this.selected = [];
this._max_upload_size_mb = 25;
}; };
NotebookList.prototype.style = function () { NotebookList.prototype.style = function () {
@ -181,11 +182,11 @@ define([
var name_and_ext = utils.splitext(f.name); var name_and_ext = utils.splitext(f.name);
var file_ext = name_and_ext[1]; var file_ext = name_and_ext[1];
// skip files over 25MB with a warning (same as Gmail) // skip large files with a warning
if (f.size > 26214400) { if (f.size > this._max_upload_size_mb * 1024 * 1024) {
dialog.modal({ dialog.modal({
title : 'Cannot upload file', title : 'Cannot upload file',
body : "Cannot upload file (>25MB) '" + f.name + "'", body : "Cannot upload file (>" + this._max_upload_size_mb + " MB) '" + f.name + "'",
buttons : {'OK' : { 'class' : 'btn-primary' }} buttons : {'OK' : { 'class' : 'btn-primary' }}
}); });
continue; continue;