Answer the question
In order to leave comments, you need to log in
Error saving file. How to decide?
Error: Can't write image data to path (C:\Users\Gates\PhpstormProjects\MyProject\public\images/posts/2018-04-20/1524232525.jpg)
Code:
if ($request->hasFile('thumbnail ')) {
$thumbnail = $request->file('thumbnail');
$filename = time() . '.' . $thumbnail->getClientOriginalExtension();
Image::make($thumbnail)->resize('300', null, function ($constraint) {
$constraint->aspectRatio();
})->save(public_path('images/posts/'. Date(' Ymd') .'/' .$filename));
}
Help to solve a problem, please.
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question