On my local development I use the code shown below, which works perfect,
but when I uploaded the site to combell everything worked fine except my file upload. I already determined that the problem is involving
->getRealPath(), when I
dd(); that I get this path:
Which doesn't exist on my hosting. But I found where the temporary images are stored on my hosting, which 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.