Re: file downloads (again)
| From: | Justin French | Date: | Mon, 17 Jun 2002 10:50:28 +0000 |
| Subject: | Re: file downloads (again) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-102490@lists.php.net to get a copy of this message | ||
Hi John,
Thanks for the reply.
I'd say the lack of passthru() was one of my many problems :)
I don't have access to dirs outside the web root, but I do have the ability
to add .htaccess files, so I'll be able to refuse direct requests to the
files.
The fact that I can't send the file as an "attachment" WHILE sending the
HTML page puzzles me a bit, because *exactly that* happens on
download.com...
You click on "download now", and you get a new HTML page, and a compressed
file comes through to you with a download window about 1-3 seconds later.
Maybe it's the compressed file that's the key????
Thanks,
Justin French
on 17/06/02 6:52 PM, John Holmes (holmes072000@charter.net) wrote:
> You're sending a application/octet-stream header and an HTML header at
> the same time... I don't see where your sending any file data, but
> that's just a snippet of code, though. In order to send the file to the
> browser, you have to set the application/octet-stream header, then do
> something like passthru($filename). That's it. You can't do that and
> HTML at the same time, though.
>
> Also note that if you're storing your mp3 inside of your web directory,
> anyone can just type in the URL to it and download whatever they want.
> You should be storing them outside of the web root.