L
L
lemonlimelike2018-07-10 17:04:09
Images
lemonlimelike, 2018-07-10 17:04:09

Why is Encoding format (tmp) not supported?

Hello. I'm trying to save the image to the server, but an error occurs. 5b44bc5bd3e1d570608904.png
Here is the method that handles this:

public function store(Request $request)
    {
        $input = $request->all();

        $img = Image::make($input['image'])->resize(700,500)->encode('jpg')->save('img/'.$input['image']);
    
        $add = new Content();
        $add->fill($input);
        $add->save();

        return response()->json($add);
    }

Well, I can understand why an error occurs when saving the file, if I do encode, that is, it seems like the file should be converted from c .tmp to .jpg, but this does not happen, why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yan-s, 2018-07-10
@lemonlimelike

Most likely, because of the name in , firstly, look at what you have there, and secondly, explicitly prescribe the extension$input['image']...->save('img/'.$imageName.'.jpg');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question