I need help in making a script that makes it so if you click a link to a media file, you will get a "Save As" or "Open" option in Internet Explorer, instead of it automatically trying to just open.
I had a solution, but recently its been failing me with larger file sizes. Basically I had the links goto a secondary file "file.php" where it would use headers to get the file.
<?php
if ($file != NULL) {
header("Content-Type: application/octet-stream");
header("Content-Length: " . filesize("media/".$file));
header("Content-Disposition: attachment; filename=".$name);
echo file_get_contents("media/".$file);
}
?>
This doesnt work for large file sizes, it just makes you download a 1KB jibberish file.
Anyone have a solution?