简体   繁体   English

权限“public”文件夹Laravel

[英]Permissions “public” folder Laravel

So I have the following folder organization in my Laravel project: 所以我在Laravel项目中有以下文件夹组织:

  • public 上市
    • user_images user_images
    • group_images group_images
    • img IMG
    • css CSS
    • vendor 供应商
    • etc ... 等......

So my problem is, when a user uploads an image I move it to the folder user_image and then I use the Intervention Image to make it smaller, I use Image::make(#folder), then re size it and at last I save it. 所以我的问题是,当用户上传图像时,我将其移动到文件夹user_image然后我使用干预图像使其变小,我使用Image :: make(#folder),然后重新调整大小,最后我保存它。 But to do that the folder user_image needs special permissions, with chmod 777 i can make it work, but I think it's a security breach if I leave the folder with 777 permissions. 但要做到这一点,文件夹user_image需要特殊权限,使用chmod 777我可以使它工作,但我认为如果我离开具有777权限的文件夹,这是一个安全漏洞。

Should I leave the folder with 777 permissions or shouldn't? 我应该保留777权限的文件夹还是不应该? Why? 为什么?

Thanks. 谢谢。

我建议你留下777 chmod,如果它只是图像,但也在该文件夹中放置一个名为“index.php”的空文件,将所有传入连接重定向到根目录。

网页用户不能对照片文件夹中的777访问造成任何伤害,所以请保留它。

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

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