I want to serve some confidential files to authenticated and authorized users. The PHP part is working well, and currently the PHP script outputs the file contents with the appropriate content types. However, some files are really large, thus, I’d like to have the HTTP Daemon to do the serving process and just “ask” PHP first if the user can get the file. How would I do this?
I want to serve some confidential files to authenticated and authorized users. The PHP
Share
For lighttpd: http://redmine.lighttpd.net/wiki/1/X-LIGHTTPD-send-file
For apache aditional mod is required: https://tn123.org/mod_xsendfile/
Usage will be like this:
If using Apache, make sure you also turn on XSendFile in your Apache configuration. Otherwise, you will be serving empty files. For example: