Zip file creation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shanthini
Forum Newbie
Posts: 12
Joined: Wed Jun 18, 2008 11:22 pm

Zip file creation

Post by shanthini »

Hi

Using the below code I am creating .zip file. But two zip files are created namly data_t.zip.a00252 and data_t.zip.b00252. Please help me to clear this


<?
$zip = new ZipArchive();
$filename = "data_t.zip";

if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE)
{
exit("cannot open <$filename>\r\n");
}

$zip->addFile("test1.txt");
$zip->addFile("test2.txt");
$zip->close();
?>
Post Reply