How to let users with required permission download a file via php?

前端 未结 5 1272
南旧
南旧 2021-01-03 00:27

I have a php file that acts as a gatekeeper for all the files I want people to download, who ahve sufficient privilages.

The code I use throw the file to the user i

5条回答
  •  长发绾君心
    2021-01-03 00:46

    You're already doing that - the $public_filename is what you want it called, the readfile($file_path) part is the file - it's location isn't made public. Past that, it could be above the document root.

提交回复
热议问题