I’ve got this list of files, and certain ones are only accessible to certain users. I’ve got a script to handle sending them the files, and it works well enough. This is the part that generates the headers and sends the file:
[PHP] header(‘Content-Description: File Transfer’);
header(“Content-Type: " . $mm_type);
header('Content-Disposition: attachment; filename=”’.basename($path).’"’);
header(‘Content-Transfer-Encoding: binary’);
header(‘Expires: 0’);
header(‘Cache-Control: must-revalidate’);
header(‘Pragma: public’);
header("Content-Length: " .(string)(filesize($path)) );
readfile($path);
exit;[/PHP]It works, but it works differently than the other links in that it automatically causes the file to be downloaded, whereas my other directly linked files usually open up in the browser without being downloaded.
Is there a way I can edit the headers to make sure that the special files are opened in the same way?