ilex01's avatar

Uploaded images are not stored into public_html/images

I want to store uploaded images in public_html/images

My code:

{
        $imageName = time() . '.' . $request->image->extension();

        $request->image->move(public_path('images'), $imageName);	

		//...

When I upload an image, it's not stored into the server in public_html/images. I cannot find the file on the FTP.

See the screencapture below for more info: https://i.gyazo.com/17eb96b7bc838a97571263b091302672.png

0 likes
2 replies
JeffH's avatar
JeffH
Best Answer
Level 8

Are you sure your public path points to that?

do a

dd(public_path('images')
2 likes
ilex01's avatar

@JeffH

dd(public_path('images'));

results:

^ "/home/objectifs/objectifs/public/images"

I've changed the path from public_path('images') to /home/objectifs/public_html/images and it works now.

Thank you a thousand times!

1 like

Please or to participate in this conversation.