I've recently been using a php code to create zip files on the fly, however all of a sudden this morning it has stopped working, even though the file has not been altered - I have tried tirelessly to fix it however I feel I've hit a brick wall!!
The file brings up the 'Zip file download' box and allows me to download it, however the zip file that is downloaded doesn't contain any files, even though it was working fine yesterday!!
Php code is below:
<?php
Header("Content-type: application/zip");
Header('Content-Disposition: attachment; filename="test.zip"');
$zipobject = new ZipArchive();
$zipobject->open("test.zip", ZipArchive::OVERWRITE);
$zipobject->addFile("img.jpg");
$zipobject->close();
echo file_get_contents("test.zip");
unlink("test.zip");
?>
If anyone has any ideas as to why I would be extremely grateful and might allow me to stop tearing out my hair in frustration
Many thanks in advance!
Chris