Zip problem of file manager

Zip problem of file manager

by Teemu Sumi -
Number of replies: 0
When you use Moodle's own zip program (PclZip), there's this problem:

When you zip one or more directories at course's root, zip program removes the first letter of directories. All the sub directories are zipped correctly but directories at root have that problem. At least with Linux you can fix that this way:

Original lines in "case zip" in "moodle/files/index.php":

foreach ($USER->filelist as $file) {
    $files[] = "$basedir/$file";
}

Fixed lines:

foreach ($USER->filelist as $file) {
    $files[] = "$basedir//$file";
}

So one slash is added. Two slashes in the file path works like single slash in Linux shell. There's no problem with the files at the course's root.


Teemu

Average of ratings: -