How do I protect large file downloads through PHP and/or Apache?

Posted by Eric on Server Fault See other posts from Server Fault or by Eric
Published on 2010-06-09T18:53:47Z Indexed on 2010/06/09 19:02 UTC
Read the original article Hit count: 303

Filed under:
|
|
|
|

We have some large files (1-8GB) that are not publicly accessible. Currently we're serving them up through a PHP script that buffers the files in 1MB chunks and writes it to the output. It's incredibly CPU intensive and slows the server down when only a few downloads are active. We want to move the file transfer work to Apache or a more efficient method. We are using cookie authentication. FTP downloads are out unless there's some way to authenticate FTP sessions through the existing PHP session cookie.

Ideally we'd like something where we can use PHP to hide the link to the file while it passes off the file transfer work to Apache, which is no doubt far more efficient at HTTP file transfers than PHP. We want to be able to resume downloads as well.

Any help is appreciated.

© Server Fault or respective owner

Related posts about apache

Related posts about php