0

Hi I have an API in Laravel, I built the API for a react native app, I have configure the storage permission by following the instructions here How to set up file permissions for Laravel?

But whenever I create a new directory and save a file into the directory if I want to view the file through the storage URL I get 403 forbidden error

403 error

please what I'm doing wrong or what I'm I supposed to do

Paulos Ab
  • 319
  • 4
  • 16
  • Usually laravel stores files inside `storage/app`, you need to ["link"](https://laravel.com/docs/9.x/filesystem#the-public-disk) that directory to `public/` (a place that is accessible via your web server). Have you done that? – Ivanka Todorova Oct 22 '22 at 16:18
  • Thanks for your quick response Ivanka, yes I have linked it to a directory outside of the laravel project root folder – Paulos Ab Oct 22 '22 at 16:19
  • can you tell what permissions have been given to your project folder. and if you ran this already ``php artisan storage:link``. – Sumit kumar Oct 22 '22 at 20:40
  • 1
    @Sumitkumar thanks for your reply, I have fixed it, I have set the file permission for folder containing the symbolic link of the storage folder and the issue still persisted, but I fixed it by calling @chmod() everytime a new file and directory is being created so that fixed it – Paulos Ab Oct 24 '22 at 18:47

0 Answers0