Secure files for download

后端 未结 2 744
忘掉有多难
忘掉有多难 2020-11-27 04:25

I want to have a folder, lets call it docs, that contains documents that logged in users can download. These have very sensitive information. How can I best secure the folde

2条回答
  •  渐次进展
    2020-11-27 05:04

    Put the files outside of the webroot. Then using PHP pass the file though a script. That way no one can link to the file directly and bypass your controls. (Naturally make sure the script that does this only after verifying the user has permission to retrieve that file).

    Sample PHP:

    
    

提交回复
热议问题