Hi,
I've been trying to get a save as download operation going for a quicktime/mp4 file.
I've tried a number of combinations but each time that I download the file, using the code below ( and variations on this) the file downloads, but is corrupted or can't be played by Quicktime.
I think I'm missing something in the header descriptions that relates to quicktime files, because I've managed to get code like this to happily download windows media files.
The code is below - and is called from a hyperlink.
Can anyone help?
<?php
$myfile=$_GET["name"];
$url = 'http://www.myserver.com/dir/'.$myfile;
header("Content-Type: video/quicktime");
if (strstr($HTTP_USER_AGENT,"MSIE 5.5")) {
$attachment = "";
} else {
$attachment = "attachment;";
}
header("Content-Disposition: $attachment filename=$myfile");
header("Content-transfer-encoding: binary\n");
$fp = fopen($url, "rb");
fpassthru($fp);
?>