I'm trying to set a file to force download using the following but the downloaded file is only 1kb and thus invalid:
$url = "/home/sites/url.com/to_download/$row[filename]";
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-disposition: attachment; filename=$row[filename]");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($url));
header("Content-Description: File Transfer");
readfile($url);
The file is a zip file which is 121mb. The path is definitely correct.
Anything obviously wrong?
UPDATE
The screenshot below looks correct but still a 1kb download - I will stress, the path and filename are correct