2
When I upload locally, using WAMP64, everything happens normally. However, when I upload by the site, which is on the production server, the following error message is displayed.
Nowritableexception in Image.php line 143:
Can’t write image data to path (/home/premiumcarstudio/Laravel/public/1481746280.jpeg)
Code I’m trying to upload
if ($request->hasFile('fileUpload')) {
$image = $request->file('fileUpload');
$filename = time() . '.' . $image->getClientOriginalExtension();
$path = public_path('images/ImagensPosts/' . $filename);
Image::make($image->getRealPath())->resize(570,350)->save(public_path($filename));
$post->imagem = 'images/ImagensPosts/'.$filename;
}
$post->save();
OBS. I’ve already changed the permissions to access the image directory on the server.
Right-click on public folder on FTP, Permissions, and select save options in the middle.
– Diego Souza
Manual on how not to ask questions
– Wallace Maxters
I believe this is permission issue, as Gumball said. Maybe you wanted to take a look at What are the risks of using permission 777
– Wallace Maxters