The clue is in the error message. You don't have rights to write to the public folder. Fix the permissions and your problem will be resolved.
Jul 18, 2017
3
Level 1
Howto upload images to public_html/domain instead of local public
Hi All I build app on local, It is working fine, when I upload it to Godaddy public_html, everything is working perfect instead of the script for upload images to public, This is errors message, I got
(1/1) NotWritableException Can't write image data to path (/home/congohost/Lara/public_html/images/1500405217.jpg)
my controller script is
$posts->title = $request->title;
$posts->slug = $request->slug;
$posts->body = $request->body;
//Save our image
if($request->hasFile('featured_image')){
$image = $request->file('featured_image');
$filename = time(). '.' . $image->getClientOriginalExtension();
$location = public_path('images/' . $filename);
Image::make($image)->resize(800, 500)->save($location);
$posts->image = $filename;
}
$posts->save();
Session::flash('success', 'The Message was successfully Post!');
return redirect()->route('posts.show', $posts->id);
}
Please or to participate in this conversation.