I have previously written a quick post on making files downloadable through PHP scripts. The example in the post reads the file itself into a variable, and as pointed out in the comments, itâ€™s not necessarily a very good idea especially if you deal with large files. Recently at work, we needed a reliable way to send files to usersâ€™ browser, and I decided to take a look at mod_xsendfile, as suggested by Tom Graham.
He starts with some of the benefits of using the xsendfile method over other, more traditional ways. Moving on, he gets to the good stuff - download, installation and a code example of how to use the module (via a X-Sendfile header).