5

The default for uploaded images appears to be /storage/app/public/profiles/, but the frontend generated URL of /storage/profiles/image isn't being found.

I tried to find any sort of routing for that directory and haven't been able to do so. Any help would be appreciated.

John Fable
  • 1,081
  • 7
  • 11

2 Answers2

8

You must link to the storage directory. From the documentation:

Once Spark is installed, you should link the public/storage directory to your storage/app/public directory. Otherwise, user profile photos stored on the local disk will not be available

And the relevant code:

ln -s /path/to/storage/app/public /path/to/public/storage
camelCase
  • 5,460
  • 3
  • 34
  • 37
  • 1
    Thank you. Can't believe I missed it. I used the Spark Installer directions and missed this section below. – John Fable Apr 25 '16 at 18:47
  • @JohnFable no problem. We've all been there, many times! Glad it helped. – camelCase Apr 25 '16 at 18:50
  • @camelCase I ran into same exact issue, though I knew it needs a symlink, I went ahead and created it but it still doesn't work for me. it's getting me 404 for routes like /storage/profiles/09c058b621dad442be436086449de1f1.jpeg – Almazik G Jun 19 '16 at 23:37
  • @AndrewMalinnkov mostly because u will need to call it by `storage/public/profiles/xxxxx.jpg` – ctf0 Jun 27 '16 at 12:05
  • @ctf0 no, not really, unfortunately :/ it still doesnt work – Almazik G Jun 28 '16 at 20:53
  • 2
    For those who interested I had to run the command `ln -sr storage/app/public public/storage` from within the Homestead Virtual Machine rather than host, which I did previously – Almazik G Jul 12 '16 at 15:13
  • any option for windows users instead of using " ln -s /path/to/storage/app/public /path/to/public/storage"? – s_h Sep 05 '16 at 00:31
  • 3
    As of Laravel 5.3 you can use the `php artisan storage:link` command – Paul Tibbetts Nov 10 '16 at 17:59
0

Just delete the storage folder inside public folder and run the command using absolute paths(from root folder).

hmilitar
  • 1
  • 2