CodeIgniter Forums
facing problems with Zip Library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: facing problems with Zip Library (/showthread.php?tid=9562)



facing problems with Zip Library - El Forum - 06-30-2008

[eluser]Moiz[/eluser]
I have used the exact example provided in the Userguide..
Code:
$this->load->library('zip');
$name = 'my_bio.txt';
$data = 'wondering if this will work...';
    
$this->zip->add_data($name, $data);
$this->zip->download('my_backup.zip');

The code is executed fine, and the file my_backup.zip is downloaded on my PC too. now the problem is when i try to extract this file using Winrar, i get an error : The archive is either unknown format or damaged.

i also tried using the $this->zip->read_dir() function as i want to create a backup of all files and folders of my website, and i get the same error.
Any clue as to why this is happening and how to solve this...

The website is hosted on a Windows server running IIS, on PHP 5.0..


facing problems with Zip Library - El Forum - 06-30-2008

[eluser]marcoss[/eluser]
I've not used the CI Zip Library but I'd suggest using a more powerful/mature library when it comes to archive handling, PEAR File_Archive will let you manipulate tar, gz, zip and a few more file formats. http://pear.php.net/package/File_Archive