Welcome Guest, Not a member yet? Register   Sign In
Making a valid zip file
#2

[eluser]rschla104[/eluser]
made some progress

This puts all of the files into the zip properly, but doesn't keep the structure

Code:
$this->load->library('zip');

$dest = './folders/user01.zip';

$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(getcwd().'/folders/user01/'));

foreach ($iterator as $key=>$value) {
   $this->zip->read_file($key);
}

$this->zip->archive($dest);

and if I pass read_file($key, TRUE) it makes the zip invalid again.


Messages In This Thread
Making a valid zip file - by El Forum - 02-01-2011, 07:15 PM
Making a valid zip file - by El Forum - 02-01-2011, 10:10 PM
Making a valid zip file - by El Forum - 02-01-2011, 10:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB