Project

General

Profile

Actions

Bug #76576

closed

Fileuploader inteprets the upload limit wrong if upload_max_filesize is too high

Added by Dimitri Lavrenük almost 8 years ago. Updated over 7 years ago.

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 #1

Updated by Wouter Wolters almost 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?

Actions #2

Updated by Dimitri Lavrenük almost 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

Actions #3

Updated by Wouter Wolters almost 8 years ago

I can't reproduce this with firefox here.

Actions #4

Updated by Susanne Moog almost 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.

Actions #5

Updated by Riccardo De Contardi over 7 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

Actions

Also available in: Atom PDF