Welcome Guest, Not a member yet? Register   Sign In
facing problems with Zip Library
#1

[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..
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB