
Untitled
By: a guest on
May 9th, 2012 | syntax:
None | size: 0.79 KB | hits: 13 | expires: Never
Weird XSendfile permissions(?) issue - force download works ok
XSendFile on
XSendFilePath /home/beef/shared/
$file = "/home/beef/shared/pic222.jpg";
header('Content-Description: File Transfer');
header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="pic222.jpg"');
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate,post-check=0, pre-check=0');
header("Cache-Control: private",false);
header('Pragma: public');
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
$file = "/home/beef/shared/pic222.jpg";
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename="pic222.jpg"");
header("X-Sendfile: ".$file);
exit;