Hiya,
I wrote this small script to just make everything downloadable instead of opening in browser, this is it:
<?php
$filename = $_GET['filename'];
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$filename");
header("Content-length: " . filesize("/usr/local/psa/home/vhosts/domain/httpdocs/methonis/images/$filename"));
echo file_get_contents("/usr/local/psa/home/vhosts/domain/httpdocs/methonis/images/$filename");
?>
Everything works fine, jpg, gif, pdf, they all download and when opened are fine. However, I also need lotus .123 files and MS publisher .pub files to be downloadable too, however, when this same thing is applied to them, it still attempts to open them in browser, and they're just trash, because the browser can't read them properly. Anyone know why the header info scheme alone won't force a download or if I need to apply some special trick to them?
Thanks for the help,
Metho