News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Phil Sturgeon's Blog:
Hijacking Headers to Force Downloads
March 29, 2012 @ 11:29:28

Phil Sturgeon shows how you can hijack headers in his latest post to force a download to the client (even on a hosted service like PagodaBox).

The question [I posed on Twitter] was: "How to force a download of any file of any type, not on your server, without Apache tweaking? Images are displaying and need em to download." Essentially, I wanted to be able to link to a file that was not on the server in question and anywhere in the world, which could be of any size, any media type and could be potentially very high traffic.

Answers varied from using readfile to just letting the browser handle it. None of the responses were quick right until he came across one that recommended some settings in an .htaccess file. It uses

0 comments voice your opinion now!
file download force header question htacess


blog comments powered by Disqus

Similar Posts

Joshua Eichorn\'s Blog: PHP AJAX File Upload Progress Meter Updates

Stefan Esser's Blog: Xdebug 2.0.3 - Stealth Patch

Simas Toleikis' Blog: PHP data caching techniques

NETTUTS.com: Getting Started With CakePHP

Knut Urdalen's Blog: Tic Tac Toe with PHP-GTK2


Community Events











Don't see your event here?
Let us know!


component framework podcast performance release composer hhvm introduction package hack security application symfony2 opinion facebook support language database install unittest

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework