Jump to content

Need Help with Download Script


icon33

Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.