spacedog4
282
13
Laravel

Shared hosting uploading images

Posted 9 months ago by spacedog4

I'm using a shared hosting to my website, so the content of public folder is on www and the project is in a folder named laravel outside of it.

The problem is, everything is working well instead of my image upload, here is where I write the file

file_put_contents(public_path() . '/upload' . $dir . $name_save, $data)

but instead of saving it on www/upload it saves in laravel/public/upload so when I try to call my image mysite.com/upload/image.png it doens't work cause it can't find the image

What am I missing?

Please sign in or create an account to participate in this conversation.