Hello everyone,
I have a download directory outside of my web root directory. I am attempting to download a file inside the download folder using fopen(). The file is an eps file. When calling the file it opens up in the browser and does not download. How can I force it to download? The file I am using to download the files is just a php script without any html code in it. Does it need to have any html code to work? Here is a sample of the code:
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$file_name\"");
header("Content-transfer-encoding: binary\n");
header("Content-length: " . filesize($download) . "\n");
$fn=fopen($download , "r");
fpassthru($fn);
Any help is greatly appreciated