-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to extract RAR successfully. #3151
Comments
@innominata The rar command cannot be used in my environment and cannot be examined in detail. What is the option specification of the rar command made manually? |
I was able to reproduce this. Quick workaround: set maxArcFilesSize option to 0 (unlimited). Looks like the problem in file size calculation. RAR can be downloaded at https://www.rarlab.com/. In my case (ubuntu) it cold be installed as 'apt install rar'. --- elFinderVolumeDriver.class.php.orig 2020-05-12 08:32:00.000000000 +0300
+++ elFinderVolumeDriver.class.php 2020-06-04 17:16:18.064460601 +0300
@@ -6643,6 +6643,7 @@
protected function getArchivers($use_cache = true)
{
$sessionKey = 'archivers';
+
if ($use_cache) {
if (isset($this->options['archivers']) && is_array($this->options['archivers']) && $this->options['archivers']) {
$cache = $this->options['archivers'];
@@ -6701,6 +6702,7 @@
}
unset($o);
$this->procExec(ELFINDER_RAR_PATH . ' --version', $o, $c);
+
if ($c == 0 || $c == 7) {
$arcs['create']['application/x-rar'] = array('cmd' => ELFINDER_RAR_PATH, 'argc' => 'a -inul', 'ext' => 'rar');
}
@@ -6902,7 +6904,10 @@
$size = preg_replace($getsize['regex'], $getsize['replace'], trim($o));
$comp = function_exists('bccomp')? 'bccomp' : 'strnatcmp';
if (!empty($this->options['maxArcFilesSize'])) {
+ error_log('chp5:'. $this->options['maxArcFilesSize']);
if ($comp($size, (string)$this->options['maxArcFilesSize']) > 0) {
+ error_log('chp6:'. $this->options['maxArcFilesSize']);
+ error_log('chp7:'. $size);
throw new Exception(elFinder::ERROR_ARC_MAXSIZE);
}
} And here is a log that I'm getting:
Looks like in the $size all extract command output. |
@667bdrm @innominata The sizing process is not adapting to UNRAR 5, so I fix it. Thanks! 👍 |
Hi there, if I create a RAR file with the context menu that has more than one file in it, it fails to extract more than the first file. (also with every other externally sourced RAR file I've tried)
I believe that the quarantine directory is being removed before the second file is copied?
I had a quick poke at elFinderVolumeLocalFileSystem.class.php but couldn't stop the quarantine directory being deleted.
Creating a ZIP, tar.gz, 7z of the same structure works fine.
Ubuntu 18.04, downloaded via composer script this morning. manually running the rar command works fine, and If I'm quick i can catch the quarantine directory having the data in it for a split second
The text was updated successfully, but these errors were encountered: