Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

FeelIt's avatar

Can't access to file from storage path in laravel 5.8

hi, I have some trouble while triying to acces file from storage path. So, i have already done php artisan storage:link. File access are fine in local using these method asset('storage/file.xx'), url('storage/file.xx') or 'storage/file.xx'. But i can't access file with these method on shared hosting and got 404 error for file link. Any idea? Can help? Thanks

0 likes
7 replies
Snapey's avatar

you need to clarify what you mean by 'access' . Are you trying to get to the file from your code (in which case you need a path) or create a link in your html (in which case you need a URL)?

The helper to use is different depending on what you are trying to do.

Did you use Storage:link on your shared hosting?

FeelIt's avatar

@EEETM - finaly, I store file in public folder then retreive them on view. for that first i have setting up disk on config/filesystems.php

'uploads' => [
          'driver' => 'local',
          'root'   => public_path(),
        ],

and then call the disk while saving file.

FeelIt's avatar

@SNAPEY - i mean by access retreive file on view. i try both path and url of file but this still not work on hosting server.

Please or to participate in this conversation.