diff --git a/frappe/boot.py b/frappe/boot.py index c4f0c42f74..ba3c353fcf 100644 --- a/frappe/boot.py +++ b/frappe/boot.py @@ -75,6 +75,7 @@ def get_bootinfo(): def load_conf_settings(bootinfo): from frappe import conf + bootinfo.max_file_size = conf.get('max_file_size') or 3145728 for key in ['developer_mode']: if key in conf: bootinfo[key] = conf.get(key) diff --git a/frappe/public/js/frappe/request.js b/frappe/public/js/frappe/request.js index f69f306c78..e697ceffdd 100644 --- a/frappe/public/js/frappe/request.js +++ b/frappe/public/js/frappe/request.js @@ -71,6 +71,10 @@ frappe.request.call = function(opts) { 508: function(xhr) { msgprint(__("Another transaction is blocking this one. Please try again in a few seconds.")); }, + 413: function(data, xhr) { + msgprint(__("File size exceeded the maximum allowed size of {0} MB", + [(frappe.boot.max_file_size || 3145728) / 1048576])) + }, 417: function(data, xhr) { if(typeof data === "string") data = JSON.parse(data); opts.error_callback && opts.error_callback(data, xhr.responseText);