Re: OT - How to code a link to download a file (program file)

From: Date: Mon, 26 Mar 2007 20:12:23 +0000
Subject: Re: OT - How to code a link to download a file (program file)
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-251413@lists.php.net to get a copy of this message
I was actually going through your blogspot on the subject and figured quite a few flaws in my code and am re-writing it as we speak. But believe it or not Richard, at the time I was researching this, and this is about 2 years back, I was provided the code that I have in this very mailing list amidst a long & elaborate discussion & post replies by various members - and quite honestly - once I took the suggested code & saw it worked as my solution, I really didn't dig any further or try to find flaws with it! On 3/26/07 4:06 PM, "Richard Lynch" <ceo@l-i-e.com> wrote: > On Mon, March 26, 2007 2:49 pm, Rahul Sitaram Johari wrote: >> header("Content-Type: application/force-download"); > > header("Content-type: asfdsgfhrsiu/luhgireughinfibvn"); > > would work equally well as application/force-download > >> header("Content-Disposition: attachment; filename=".basename($F)); >> @readfile($F); >> ?> >> >> $F was the filename passed as a variable. > > And if $F is set to /etc/passwd what does your script hand out?

« previous php.general (#251413) next »