Skip to content

Commit d72520c

Browse files
author
Fabien MICHEL
authored
fix: uploadButton data-max-filesize attribute is not passed to file-uploader (#1503)
1 parent efa9892 commit d72520c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

filer/static/filer/js/addons/upload-button.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if (django.jQuery) {
2929
var infoMessage = $('.js-filer-dropzone-info-message');
3030
var hiddenClass = 'hidden';
3131
var maxUploaderConnections = uploadButton.data('max-uploader-connections') || 3;
32+
var maxFilesize = parseInt(uploadButton.data('max-filesize') || 0, 10) * 1048576;
3233
var hasErrors = false;
3334
var updateUploadNumber = function () {
3435
uploadNumber.text(maxSubmitNum - submitNum + '/' + maxSubmitNum);
@@ -59,6 +60,7 @@ if (django.jQuery) {
5960
action: uploadUrl,
6061
button: uploadButton[0],
6162
maxConnections: maxUploaderConnections,
63+
sizeLimit: maxFilesize,
6264
onSubmit: function (id) {
6365
Cl.mediator.remove('filer-upload-in-progress', removeButton);
6466
Cl.mediator.publish('filer-upload-in-progress');

0 commit comments

Comments
 (0)