simialbi / yii2-elfinder

This extension integrates the jQuery elFinder into yii2 framework
MIT License
7 stars 5 forks source link

download content issue, too large for download #19

Closed paskuale75 closed 2 years ago

paskuale75 commented 2 years ago

elfinder_downloadFolderissue Where I can set this param ? I tried to download a folder with the size of 9.43 Gb ....could it deal with php.ini settings?

simialbi commented 2 years ago

What's the error message? Timeout?

paskuale75 commented 2 years ago

{"error":["errArchive","errArcMaxSize"]}

simialbi commented 2 years ago

you can set the max size to 0 to prevent this error:

'modules' => [
    'elfinder' => [
        'class'          => 'simialbi\yii2\elfinder\Module',
        'options'        => [
            'default' => [
                'class'      => 'simialbi\yii2\elfinder\ElFinderOptions',
                'locale'     => 'de_DE.UTF-8',
                'maxTargets' => 0,
                                'maxArcFilesSize' => 0 // <= THIS LINE
            ]
        ],
        'connectionSets' => [
            'default' => [ // like elfinder roots
                [
                    'class' => 'simialbi\yii2\elfinder\ElFinderConfigurationLocalFileSystem',
                    'path'  => '@webroot/files',
                    'URL'   => '@web/files'
                ]
            ]
        ],
        'volumeBehaviors' => [
            'default' => [ // like elfinder plugins, add behaviors
                'as resizer'   => [
                    'class'     => 'simialbi\yii2\elfinder\behaviors\ImageResizeBehavior',
                    'maxWidth'  => 1920,
                    'maxHeight' => 1080,
                    'quality'   => 70
                ],
                'as optimizer' => [
                    'class' => 'simialbi\yii2\elfinder\behaviors\ImageOptimizeBehavior'
                ]
            ]
        ]
    ]
]
paskuale75 commented 2 years ago

I add it to my elfinder options, but don't work continue to return: {"error":["errArchive","errArcMaxSize"]} :'(

simialbi commented 2 years ago

What does the log say?

paskuale75 commented 2 years ago
2022-02-15 14:02:47 [101.56.26.188][22][-][info][yii\filters\RateLimiter::beforeAction] Rate limit skipped: "user" does not implement Rat>
2022-02-15 14:06:49 [45.146.165.37][-][u8s547dtahtihekenni9fcebk6][warning][yii\debug\Module::checkAccess] Access to debugger is denied d>
    in /var/www/html/my_app/app/views/themes/adminlte3/views/layouts/main.php:81
2022-02-15 14:06:49 [45.146.165.37][-][u8s547dtahtihekenni9fcebk6][warning][yii\debug\Module::checkAccess] Access to debugger is denied d>
2022-02-15 14:15:27 [101.56.26.188][22][-][info][yii\filters\RateLimiter::beforeAction] Rate limit skipped: "user" does not implement Rat>
2022-02-15 14:53:34 [45.146.165.37][-][-][warning][yii\debug\Module::checkAccess] Access to debugger is denied due to IP address restrict>
    in /var/www/html/my_app/app/views/themes/adminlte3/views/layouts/main.php:81
    in /var/www/html/my_app/app/controllers/SiteController.php:63
2022-02-15 14:53:34 [45.146.165.37][-][-][warning][yii\debug\Module::checkAccess] Access to debugger is denied due to IP address restrict>
2022-02-15 15:31:36 [175.180.143.138][-][-][warning][yii\debug\Module::checkAccess] Access to debugger is denied due to IP address restri>
    in /var/www/html/my_app/app/views/themes/adminlte3/views/layouts/main.php:81
    in /var/www/html/my_app/app/controllers/SiteController.php:63
2022-02-15 15:31:36 [175.180.143.138][-][-][warning][yii\debug\Module::checkAccess] Access to debugger is denied due to IP address restri>
2022-02-15 15:31:36 [175.180.143.138][-][varvpi1r9bqpiugc1feno92k49][warning][yii\debug\Module::checkAccess] Access to debugger is denied>
    in /var/www/html/my_app/app/views/themes/adminlte3/views/layouts/main.php:81
2022-02-15 15:31:36 [175.180.143.138][-][varvpi1r9bqpiugc1feno92k49][warning][yii\debug\Module::checkAccess] Access to debugger is denied>
simialbi commented 2 years ago

What does it dump if you try to add following snippet to @vendor/studio-42/elfinder/php/elFinderVolumeLocalDriver.php (https://github.com/Studio-42/elFinder/blob/f10dee5ae3ca266d18b4cc1692e1c4d978afe070/php/elFinderVolumeLocalFileSystem.class.php#L1208):

echo "<pre>";
var_dump($this->options['maxArcFilesSize']);
exit("</pre>");
paskuale75 commented 2 years ago

Hi @simialbi it respond with this: (from console) elfinder debug: [error] [w0] Impossibile creare archivio.<br>La dimensione dell'archivio supera le massime dimensioni consentite. (from network) {"error":["errArchive","errArcMaxSize"]}

P.S. I have empty the /runtime/cache folder and put adie($ this-> options ['maxArcFilesSize']); here

// check max files size
            if ($this->options['maxArcFilesSize'] > 0 && $this->options['maxArc>
                $this->delTree($dir);
die($this->options['maxArcFilesSize']);
                return $this->setError(elFinder::ERROR_ARC_MAXSIZE);
            }

no result....no die message!!

simialbi commented 2 years ago

make a var_dump. If it's an int value, die takes it as exit code

paskuale75 commented 2 years ago

Very strange, I added this:

// check max files size
            if ($this->options['maxArcFilesSize'] > 0 && $this->options['maxArc>
                $this->delTree($dir);
                var_dump('maxArcFilesSize = '.$this->options['maxArcFilesSize']);
                return $this->setError(elFinder::ERROR_ARC_MAXSIZE);
            }

... I clean /runtime/cache/* ...but it doesn't print the var_dump to me!

I tried with

var_dump('maxArcFilesSize = '.$this->options['maxArcFilesSize']);
             if ($this->options['maxArcFilesSize'] > 0 && $this->options['maxArc>
                $this->delTree($dir);
                return $this->setError(elFinder::ERROR_ARC_MAXSIZE);
            }

too ... same result, don't return any string or int ...

simialbi commented 2 years ago

add an exit after the dump, otherwise it will continue execution of the normal code and return a json value;

paskuale75 commented 2 years ago
// check max files size
                var_dump('maxArcFilesSize = '.$this->options['maxArcFilesSize']);
                exit;
            if ($this->options['maxArcFilesSize'] > 0 && $this->options['maxArcFilesSize'] <>
                $this->delTree($dir);
                return $this->setError(elFinder::ERROR_ARC_MAXSIZE);
            }

...absurd, keep returning me with the same answer !!

simialbi commented 2 years ago

Ok. Are you able to prepare an ftp account and a sign in for the application for me? So I could have a look tomorrow?

paskuale75 commented 2 years ago

Sure, @simialbi write me to pellicanipasquale at gmail dot com I send you login data, thank you

paskuale75 commented 2 years ago

Maybe I found some fix... I test on localhost and I added this at line 197 of vendor/studio-42/elfinder/php/elFinderVolumeLocalFileSystem.class.php

is_dir($_quarantine) && self::localRmdirRecursive($_quarantine);

        parent::configure();

        // check max files size
        echo '<pre>';
        echo $this->options['maxArcFilesSize'];
        echo '</pre>';
        exit;

if I set 'maxArcFilesSize' => -1 return to me this -> 18446744073709551615 (18446744073 Gb !!) If I set 'maxArcFilesSize' => 0 return to me this -> 2147483648 (default 2 Gb ?)

the problem is that online it still doesn't work...

simialbi commented 2 years ago

It was a cache problem. I cleared the cache, so the framework loaded the new configured options and the problem was solved...