Re: Binary File Download problems.
| From: | Rob Lacey | Date: | Fri, 25 Apr 2003 11:50:00 +0000 |
| Subject: | Re: Binary File Download problems. | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145247@lists.php.net to get a copy of this message | ||
I use the following headers to send the file (in this instance an mp3 file)
--8<---
header("Cache-control: private");
header("Content-Type: application/octet-stream");
header("Content-Length: " . filesize($file_path));
header("Content-Disposition: attachment; filename=" . $filename);
--8<---
So you get a download window with the correct filename displayed and
everything. tried using header("Content-Type: audio/x-mp3"); which proceeded
to stream the file (cool but not the desired effect) so at this point started
scratching my head.
What is confusing me is that I thought that once the download starts I should
really be able to continue browsing as normal, as if I have clicked on a
direct link to that file. At least that's what I want to acheive.
Thanks.
On Friday 25 Apr 2003 12:15 pm, you wrote:
> What headers do you use? Do you use
> header("Content-Disposition: attachment; filename=$filename" );
>
> ?