unable to zip files with more than 800MB of size using zip-packer function.

unable to zip files with more than 800MB of size using zip-packer function.

by hina yousuf -
Number of replies: 3

HI!

i am using moodle 2.03.i am writing a function to zip all the course files in a single folder.But when the course files are more than 800 MB this function does not work.

i am using the following function.Please help me how can i allow this function to create zip folder of  files with more than 200 MB.

function assignment_pack_files($filesforzipping) {
        global $CFG;
        //create path for new zip file.
        $tempzip = tempnam($CFG->dataroot.'/temp/', 'assignment_');
        //zip files
        $zipper = new zip_packer();
        if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) {
            return $tempzip;
        }
        return false;
}

Average of ratings: -
In reply to hina yousuf

Re: unable to zip files with more than 800MB of size using zip-packer function.

by hina yousuf -

I Just figured out the issue my self.Just increase the maximum exection time and memory limit in php.ini file and it will work.

In reply to hina yousuf

Re: unable to zip files with more than 800MB of size using zip-packer function.

by Rosario Carcò -

Did you finish your work? I am doing the same thing for students and teachers. I developed a block so that they can download all published files as a zip_archive. Before publishing my block I have to find out how to serve the zip-file to the users' browser.

Any hints are very appreciated, Rosario