your script is probably timing out.

Try doing:
set_time_limit(0); 

at the top of your script.

Jeremy

Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: [EMAIL PROTECTED]
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    "LINUX is obsolete"  -- Andy Tanenbaum, January 29th, 1992
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
       http://www.JEEP-FOR-SALE.com/ -- I need a buyer
  Get your own Free, Private email at http://www.smackdown.com/

On Fri, 19 Jan 2001, Juan Germano wrote:

> Date: Fri, 19 Jan 2001 05:38:48 -0300
> From: Juan Germano <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP] Downloads, headers and binary data
> 
> Hi. I'm trying to write a script to download a mp3 file. I did this:
> 
> $filesize=filesize($filename);
> header("Content-disposition: attachment;filename=".basename($filename));
> header("Content-type: application/octetstream");
> header("Content-Transfer-Encoding: binary");
> header("Pragma: no-cache");
> header("Expires: 0");
> header("Content-Length: $filesize");
> readfile($filename,$filesize);
> 
> I began with the first two headers but the problem is that the script works
> fine with
> text files but I get shorter files than the originals with mp3s, so I added
> the rest trying to solve the problem.
> So I tryied
> 
> $fp=fopen($filename,"r");
> fread($fp,filesize($filename));
> fclose($fp);
> 
> and
> 
> $fp=fopen($filename,"r");
> fpassthru($fp);
> 
> None of above worked.
> But I tryied using the php.exe and I got exactly what I want.
> So, perhaps it is a problem with the headers. I tryied both Netscape and IE,
> and also diferents content-type (audio/mpeg).
> Anyone has ideas?
> 
> Juan Germano
> [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to