Actions
Bug #76576
closedFileuploader inteprets the upload limit wrong if upload_max_filesize is too high
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-06-10
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
7
PHP Version:
5.6
Tags:
drag file uploader
Complexity:
no-brainer
Is Regression:
No
Sprint Focus:
Description
While uploading file in the backend a div element is generated to forward configuration to the fileuploader js scripts. With upload_max_filesize set to 128M this looks like this:
<div class="t3js-drag-uploader" data-target-folder="1:/" data-progress-container="#typo3-filelist" data-dropzone-trigger=".t3js-drag-uploader-trigger" data-dropzone-target=".t3js-module-body h1:first" data-file-deny-pattern="\.(php[3-7]?|phpsh|phtml)(\..*)?$|^\.htaccess$" data-max-file-size="1.3421773E+8" ></div>
As you can see the max file size output is not integer but of the float type
data-max-file-size="1.3421773E+8"
The uploader js code intepretes it as integer:
typo3/sysext/backend/Resources/Public/JavaScript/DragUploader.js line 76
me.maxFileSize = parseInt(me.$element.data('max-file-size'));
This leads to me.maxFileSize being 1 and not 134217730
To change the behavior you could modify the output of the data-max-file-size="xx" or change the js intepretation to
me.maxFileSize = parseFloat(me.$element.data('max-file-size'));
I can not download the full core to search for the html output so modifying the js file works for me
Actions