Login   Register  
PHP Classes
elePHPant
Icontem

Corruption when zipping multiple files

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      TAR/GZIP/BZIP2/ZIP Archives  >  All threads  >  Corruption when zipping multiple files  >  (Un) Subscribe thread alerts  
Subject:Corruption when zipping multiple files
Summary:Works for single file, but corrupts with multiple files
Messages:1
Author:GSchlais
Date:2009-05-09 20:37:32
 

  1. Corruption when zipping multiple files   Reply  
Picture of GSchlais
GSchlais
2009-05-09 20:37:33
This script works great as long as there is only one file in the directory to add to the zip file. The resulting file can be extracted on linux, windows and Mac. The problem is when I add more than one file to the zip, the resulting archive will only extract on the linux machine. Both windows and Mac complain about an unexpected end of file.

Can anyone help?

<?php
require_once('includes/archive.inc');

$test = new zip_file("HoG/$KIT".".zip");
$test->set_options(array('inmemory' => 0, 'recurse' => 0, 'storepaths' => 0));

$test->add_files("HoG/$KIT"."*.pdf");

$test->create_archive();

?>