mriyadh's avatar

Upload images with lumen and files permissions

Hi, I'm trying to build my own API for mobile application using Lumen and every thing is great till i came to upload images from the mobile app to my web server and save the URL in mysql database, because i'm new in the web servers world i have the following questions :

  1. (most important) lets assume my project folder named TestProject and i want to save the images under Testproject/public/Images/user_id/img.png what permissions should i use to make only the web server write the folders and images and any body else can only read the images ?

  2. Is it safe to save the images in the public folder or should i save them in the storage folder ?

Any explanation would be much appreciated

0 likes
3 replies
shez1983's avatar

when you say upload images do you mean user images or public images?

if user images then they should be stored in storage/ and programmatically given access if user needs to see them..

mriyadh's avatar

Its public Images not something private for the user

Please or to participate in this conversation.