Re: [PHP Header] Right-Click Download in Firefox showing php filename

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/3/08, Will <wilzdezign@xxxxxxxxx> wrote:

> @readfile($filename);

You should look into a webserver and instead of using readfile() which
will keep the PHP engine open while it is spoonfeeding the browser,
offload the file to the webserver.

nginx has X-Accel-Redirect (nginx is the best anyway)
Lighttpd has X-Lighttpd-Sendfile (or something)
Apache has mod_sendfile (something like that)

etc.

I don't think it will change the renaming behavior, but it will
offload your PHP engines for normal processing. :)

Basically (you'll have to configure it quick but otherwise) instead of
the readfile($file) you'd be sending another:

header("X-Accel-Redirect: $file"); (you have to configure $file's location)

and that's it. the webserver takes over and PHP is released back to do
other things.

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux