如何使用 ACL 避免未经授权访问 CakePHP 的 webroot 文件夹中的文件?
我的 CakePHP webroot 文件夹中有一个文件夹,我希望[仅]登录用户访问 webroot 中的此文件夹/文件!是否可以?
例如:
如果未登录:
www.example.com/app/webroot/pdf/word.doc
这应该会产生一条消息,提示请登录
I have a folder inside my CakePHP webroot folder, I want [ONLY] logged-in users to access this folder/files inside webroot! Is it possible?
For example:
If not logged in:
www.example.com/app/webroot/pdf/word.doc
This should yield a message saying please login
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,这是不可能的,因为框架不处理对
webroot
文件夹中文件的访问。媒体视图可能就是您正在寻找的。
No, this is not possible because the access to the files in the
webroot
folder is not handled by the framework.The media view is probably what you are looking for.