From a34e0b72a9503d681c305b016b12c11e13f1bff7 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 21 Oct 2015 09:17:47 -0500 Subject: [PATCH 1/2] Bump upload size to 25MB --- notebook/static/tree/js/notebooklist.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index 92d611804..af3cc23c1 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -181,11 +181,11 @@ define([ var name_and_ext = utils.splitext(f.name); var file_ext = name_and_ext[1]; - // skip files over 15MB with a warning - if (f.size > 15728640) { + // skip files over 25MB with a warning (same as Gmail) + if (f.size > 26214400) { dialog.modal({ title : 'Cannot upload file', - body : "Cannot upload file (>15MB) '" + f.name + "'", + body : "Cannot upload file (>25MB) '" + f.name + "'", buttons : {'OK' : { 'class' : 'btn-primary' }} }); continue; From c8c4b2768cf6b815e2e8a9e21a6c427afe2a043a Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 21 Oct 2015 10:59:17 -0500 Subject: [PATCH 2/2] Make the upload size limit configurable --- notebook/static/tree/js/notebooklist.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/notebook/static/tree/js/notebooklist.js b/notebook/static/tree/js/notebooklist.js index af3cc23c1..4cf108d01 100644 --- a/notebook/static/tree/js/notebooklist.js +++ b/notebook/static/tree/js/notebooklist.js @@ -46,6 +46,7 @@ define([ function(e, d) { that.sessions_loaded(d); }); } this.selected = []; + this._max_upload_size_mb = 25; }; NotebookList.prototype.style = function () { @@ -181,11 +182,11 @@ define([ var name_and_ext = utils.splitext(f.name); var file_ext = name_and_ext[1]; - // skip files over 25MB with a warning (same as Gmail) - if (f.size > 26214400) { + // skip large files with a warning + if (f.size > this._max_upload_size_mb * 1024 * 1024) { dialog.modal({ 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' }} }); continue;