I
I
Igor Kudryash2017-09-11 18:21:19
Laravel
Igor Kudryash, 2017-09-11 18:21:19

NotReadableException laravel how to solve the problem?

Hello. There was a problem, I spent a lot of time, I didn’t find a solution anywhere (
In short, I’m trying to upload a picture, I use Intervantion image .
A piece of script:

$image = Image::make($imageInstance);
$newFilePath = 'app/public/static/articles/' . $articleId . '/' . $uniqueFilename . '.' . $imageExtension;
$image = $image->save(storage_path($newFilePath));

When the picture starts to load, an error occurs .
3d2695dcaf5048f49113901e59f5d691.png
Here is a dump in Request
0742447509784fd58feb9cfc4410b6fb.png
Strange mimeType. The picture itself is in JPG format.
Maybe someone faced such a problem? If you know how to solve it, I will be very grateful :)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
D3lphi, 2017-09-11
@D3lphi

The name of the exception speaks for itself "Not readable" - that is, not readable. The program cannot access the image. Apparently you don't have permission to read the file. Change them with chmod.

K
Konstantin B., 2017-09-11
@Kostik_1993

The image has no name, the script instead of the file gets the folder in which it lies. The script swears that the picture did not come to him, so look at the path

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question