简体   繁体   English

Laravel:文件可见性的用例?

[英]Laravel: Use case for File Visibility?

I am using Laravel with a local filesystem as storage driver.我将 Laravel 与本地文件系统一起用作存储驱动程序。

I have understood that I can save files in the storage/public folder to make them accessible through myapp.dev/storage/image.jpg .我知道我可以将文件保存在storage/public文件夹中,以便通过myapp.dev/storage/image.jpg访问myapp.dev/storage/image.jpg I have also understood that I can make images accessible only for authenticated users like explained here .我也明白,我可以让图像只认证用户喜欢访问解释这里

What I have not understood it the File Visibility property.我还没有理解它的文件可见性属性。 If files are public depending on the folder that I stored them, why would I need to declare them additionally as private or public ?如果文件是公开的取决于我存储它们的文件夹,为什么我需要将它们另外声明为privatepublic Could anyone give a use case where this would be necessary?任何人都可以给出一个需要这样做的用例吗?

File visibility option matters only if you are using cloud storage provider, eg Amazon S3 or something like that.文件可见性选项仅在您使用云存储提供商时才重要,例如 Amazon S3 或类似的东西。 If you are working with local file system then that option is ignored.如果您正在使用本地文件系统,则该选项将被忽略。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM