mardi 30 octobre 2018

Newly uploaded files are forriben for acccess

While my Laravel 5.7 app in PROD mode I need to upload images from my local laptop to my server, as my app has some demo data and for this I modified file /_wwwroot/lar/Votes/storage/app/public/.gitignore :

# *
# !.gitignore
tmp
.tag-details
.user-avatars
.vote-items
.votes

It means that content of tmp DIR is not uploaded to server, but new files in 4 rest folder would be uploaded to server. In PROD mode I would comment these 4 folder and new files would not be uploaded to server. Is it good decision?

But trying to open page with newly uploaded image I got 403 error(Forbidden) even after I run command

sudo chmod -R 755 /var/www/html/votes/storage/app/public/tag-details/*

and in console of my server I see :

# ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
>              *2^(8-i));if(k)printf("%0o ",k);print}'
total 68
755 drwxr-xr-x 2 root     root     4096 Oct 30 06:06 -tag-detail-1


# ls -l | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/) \
>              *2^(8-i));if(k)printf("%0o ",k);print}'
total 28
755 -rwxr-xr-x 1 root root 26550 Oct 30 06:06 hamlet.jpg

Why error and which decision ?

Thanks!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2RovnDl
via IFTTT

Aucun commentaire:

Enregistrer un commentaire