5

So I have the following folder organization in my Laravel project:

  • public
    • user_images
    • group_images
    • img
    • 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. 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.

Should I leave the folder with 777 permissions or shouldn't? Why?

Thanks.

2 Answers 2

7

I would suggest that you leave 777 chmod if it is only images but also place an empty php file called "index.php" inside that folder that will redirect all incoming connection to the root.

1
  • Thank you, helped a lot.
    – Hugo
    Commented Dec 26, 2015 at 16:53
2

web user can't do any harm with 777 access in photos folder, so leave it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.