I'm trying to use some header functions to force the browser to download
quicktime movies. I have a small piece of code that takes the relevant file
name from the url and then uses that in the header function. This code sits
in get.php. Unfortunately, all I download when I click the link is get.php.
Although the name is changed to the desired file name (eg 193430239.mov).
The code is:

/*retrieve filename from url*/
$current=$REQUEST_URI;
$url=parse_url($current);
$fileq=$url[query];
$file=$fileq.".mov";

/*force download*/
header("Content-type:application/octet-stream\n");
header("Content-disposition:attachment; filename=\"$file\"\n");
header("Content-transfer-encoding:binary\n");
header("Content-length:".filesize($file)."\n");

/*send file contents */
$fp=fopen($file,"r");
fpassthru($fp);

I can't tell you how long it's taken me to download anything and I'm still
getting can't add header errors, but at least I'm downloading something. But
how do I download the desired movie file....?

Many Many Thanks to all who have helped so far,

Ian


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to