Download Issue

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
gazzieh
Forum Commoner
Posts: 40
Joined: Wed May 19, 2010 7:46 am

Download Issue

Post by gazzieh »

I have a piece of code that has, until recently, seemedly working fine:

Code: Select all

$fullpath = 'resources/downloads/' . $info . '.zip';
header("Pragma: public"); // required
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false); // required for certain browsers
header("Content-Type: application/zip");
header("Content-Disposition: attachment; filename=\"".basename($fullpath)."\";" );
header("Content-Transfer-Encoding: binary");
ob_clean();
flush();
readfile( $fullpath );
However, now I am only getting a file of 211 bytes in size. I cannot see what has changed and cannot even begin to think of why this is happening. I doubt it is the code but any ideas?
Post Reply