PHP to protect PDF and DOC

后端 未结 4 468
名媛妹妹
名媛妹妹 2021-01-01 03:10

I am trying to provide .pdf and .doc files to authorized users on a website. The user can only see the file selection page when logged in but this

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-01 03:55

    What you can do, is provide the equivalent of a PHP proxy for the files.

    Put the files outside of the webroot, then write a script that checks the user is allowed access. If not, redirect them, if they do, set the appropriate headers and output the file data.

提交回复
热议问题