icon33 Posted February 11, 2009 Share Posted February 11, 2009 Works on testing server (xampp) But Not Live! <?php Header("Content-type: application/zip"); Header('Content-Disposition: attachment; filename="test.zip"'); $zipobject = new ZipArchive(); $zipobject->open("test.zip", ZipArchive::OVERWRITE); foreach (glob("images/"."*.jpg") as $filename) { $zipobject->addFile("$filename"); } $zipobject->close(); echo file_get_contents("test.zip"); unlink("test.zip"); ?> Please Help!! Quote Link to comment Share on other sites More sharing options...
andy_b42 Posted February 11, 2009 Share Posted February 11, 2009 Are you getting any errors when it is running live? Quote Link to comment Share on other sites More sharing options...
icon33 Posted February 11, 2009 Author Share Posted February 11, 2009 the zip is corrupt and will not open - thnx there is no error on on the actual page! Quote Link to comment Share on other sites More sharing options...
icon33 Posted February 11, 2009 Author Share Posted February 11, 2009 Sorry - Here are the page errors.... Warning: ZipArchive::addFile() [ziparchive.addfile]: Invalid or unitialized Zip object in /homepages/29/d151991167/htdocs/instant/casana/index.php5 on line 10 Warning: ZipArchive::close() [ziparchive.close]: Invalid or unitialized Zip object in /homepages/29/d151991167/htdocs/instant/casana/index.php5 on line 13 Warning: file_get_contents(test.zip) [function.file-get-contents]: failed to open stream: No such file or directory in /homepages/29/d151991167/htdocs/instant/casana/index.php5 on line 15 Warning: unlink(test.zip) [function.unlink]: No such file or directory in /homepages/29/d151991167/htdocs/instant/casana/index.php5 on line 17 Quote Link to comment Share on other sites More sharing options...
icon33 Posted February 11, 2009 Author Share Posted February 11, 2009 fixed - change $zipobject->open("test.zip", ZipArchive::OVERWRITE); to $res=$zipobject->open("test.zip", ZipArchive::CREATE); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.