Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
问题陈述
不要直接链接到 PDF 文件。甚至不要为 PDF 文件提供公共 URL。
链接到一个 PHP 程序,该程序执行您想要的任何用户身份验证/授权,然后根据该程序执行操作。如果决定为他们提供 PDF,则使用该header()功能为其设置正确的内容类型,并readfile()输出 PDF 数据。
header()
readfile()