Bug #76576
closedFileuploader inteprets the upload limit wrong if upload_max_filesize is too high
0%
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
Updated by Wouter Wolters over 8 years ago
- Status changed from New to Needs Feedback
In which browser do you have this behaviour?
Which exact TYPO3 7 version do you use?
Updated by Dimitri Lavrenük over 8 years ago
Typo3 version is 7.6.9
i had the bug with firefox before fixing it, but since this part
data-max-file-size="1.3421773E+8"
is generated by the server it should be intepreted by parseInt() as 1 in any browser
Updated by Wouter Wolters over 8 years ago
I can't reproduce this with firefox here.
Updated by Susanne Moog over 8 years ago
Can you add some more information: Which upload div is that?
I just tested with 128M and 512M and get 134217728 / 536870912 directly in file list module.
Updated by Riccardo De Contardi about 8 years ago
- Status changed from Needs Feedback to Closed
No feedback since 90 days > closing this issue.
If you think that this is the wrong decision or experience the issue again or have more information about how to reproduce, please open a new issue with a reference to this one.
Thank you