From d72520c329beb40788f0c9a6b685af8bc591581e Mon Sep 17 00:00:00 2001 From: Fabien MICHEL Date: Wed, 16 Oct 2024 18:54:19 +0200 Subject: [PATCH] fix: uploadButton data-max-filesize attribute is not passed to file-uploader (#1503) --- filer/static/filer/js/addons/upload-button.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/filer/static/filer/js/addons/upload-button.js b/filer/static/filer/js/addons/upload-button.js index d53d07f80..ff68974e2 100644 --- a/filer/static/filer/js/addons/upload-button.js +++ b/filer/static/filer/js/addons/upload-button.js @@ -29,6 +29,7 @@ if (django.jQuery) { var infoMessage = $('.js-filer-dropzone-info-message'); var hiddenClass = 'hidden'; var maxUploaderConnections = uploadButton.data('max-uploader-connections') || 3; + var maxFilesize = parseInt(uploadButton.data('max-filesize') || 0, 10) * 1048576; var hasErrors = false; var updateUploadNumber = function () { uploadNumber.text(maxSubmitNum - submitNum + '/' + maxSubmitNum); @@ -59,6 +60,7 @@ if (django.jQuery) { action: uploadUrl, button: uploadButton[0], maxConnections: maxUploaderConnections, + sizeLimit: maxFilesize, onSubmit: function (id) { Cl.mediator.remove('filer-upload-in-progress', removeButton); Cl.mediator.publish('filer-upload-in-progress');