I think the tmp folder shown in your screenshot is the tmp folder outputted by dd()
Is the '/images/producten/' folder writable?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
On my local development i use the following code, wich works perfect, but when i uploaded the site everything works fine except my file upload. I already determined that the problem is ->getRealPath() , when i dd(); that i get this path: "/data/sites/web/christophvhbe/tmp" wich doenst exist on my hosting. But i found where the temporary images are stored on my server , wich is in the tmp/ located here: http://gyazo.com/e0199718324119109a4ff66321414e12 . How can i change the ->getRealPath() value to the correct value?
$fileName = time() . '-' . $request->file('foto')->getClientOriginalName();
$product->foto = $fileName;
$product->save();
$imagePath = '/images/producten/'. $fileName;
$image = Image::make($request->file('foto')->getRealPath())->fit(300)- >save($imagePath);
I'm using the Image/intervention package to upload and store images
This is a pretty old question that has been solved here:
http://stackoverflow.com/questions/30970532/laravel-5-getrealpath-doenst-show-correct-value
Please or to participate in this conversation.