How to securely store files on a server

前端 未结 3 1756
长发绾君心
长发绾君心 2021-01-12 03:54

What I\'m Doing:

I basically need to create a website secured by a login page written in PHP that once logged in, you have a search bar that reads i

3条回答
  •  花落未央
    2021-01-12 04:41

    A recommended way of handling file downloads via PHP (or any other script) is by using the so called 'X-Sendfile' response header.

    The PHP script handles the authentication and once validated it will set a few response headers together with an 'X-Sendfile' that tells the web server to deliver a file; the script ends and the web server takes over.

    See here for a simple example:

    http://www.jasny.net/articles/how-i-php-x-sendfile/

提交回复
热议问题