Armand Niculescu, BEng, MSM, is a 34 year old Art Director at Media Division. and he enjoys working with visual arts for film, web and print.

6 responses to “The “right way” to handle file downloads in PHP”

  1. tim

    Great post. alot of stuff that I have over looked. Im having issues though. I’m running two servers 1 delivers the site the other podcast files. Im trying to get the remote files with using headers but it kills the ability for the user to be able to stream the podcast. any ideas?

  2. tim
  3. tim

    Armand, I agree with you 100% But sometimes when your under the gun and need working code you have to do what you have to do. Using php headers has a file delivery method is new too me, never done and I needed a solution ASAP. This method works for now and I plane to develop a better functioning version of this.

  4. Midhun

    Thanks Armand for that one… Really helped…

  5. a.l.e

    from readfile’s documentation

    http://php.net/manual/en/function.readfile.php

    it looks like that readfile correctly manages large files. other howtos seem to confirm this.