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!! Link to comment https://forums.phpfreaks.com/topic/144739-need-help-with-download-script/ 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? Link to comment https://forums.phpfreaks.com/topic/144739-need-help-with-download-script/#findComment-759559 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! Link to comment https://forums.phpfreaks.com/topic/144739-need-help-with-download-script/#findComment-759880 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 Link to comment https://forums.phpfreaks.com/topic/144739-need-help-with-download-script/#findComment-759899 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); Link to comment https://forums.phpfreaks.com/topic/144739-need-help-with-download-script/#findComment-759917 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.