Andrew
Andrew

Reputation: 2198

Laravel store image into public/images

I use Laravel 5.1 framework and I need to store images, so I decide to be /public/images folder with 777 permision.

So at table article at column photo I store url:

http://domain.com/public/images/odOlG.jpg

Now when I try to get it - when I try url: http://domain.com/public/images/odOlG.jpg

I get this error from Laravel: enter image description here

So how to solve this problem? Why Laravel need route for file - image... also yes I check and image is into /public/images folder...

Upvotes: 1

Views: 524

Answers (1)

Alexey Mezenin
Alexey Mezenin

Reputation: 163798

You should use URL without public:

http://domain.com/images/odOlG.jpg

If it doesn't work, but I have odOlG.jpg in /public/images directory, then your web server configuration is wrong. You should point Apache to a public folder, not the Laravel's root project, like this:

DocumentRoot "/path_to_laravel_project/public"
<Directory "/path_to_laravel_project/public">

Upvotes: 1

Related Questions