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.
如果我将某人链接到文件:
site.com/file.php?id=someid
~/files/somefile.zip并获得一个位于文档根目录之外的网址,这会起作用吗?这样做有安全风险吗?
~/files/somefile.zip
你试过了吗?那应该可以正常工作;php 不关心文档根目录。
它还使您可以更好地控制何时以及向谁提供文件,因此在很多情况下它实际上是在提高安全性(例如,如果文件应该只在登录后可用)。