nafeeur10's avatar

Guzzle HTTP give me error

Trying to upload file:

private function getOptions($data = null)
{
        $options['multipart'] = [
            [
                'name' => 'name',
                'contents' => $data['name']
            ],
            [
                'name' => 'description',
                'contents' => $data['description']
            ],
            [
                'name' => 'is_published',
                'contents' => $data['is_published']
            ],
            [
                'name' => 'thumb',
                'contents' => base64_encode(file_get_contents($data['thumb']))
            ]
        ];

        return $options;
    }

From where I am calling this, it is giving me data like this:

dd($this->getOptions($data));

Image of given data: https://ibb.co/9Tk38Vh

URL is giving me correct URL. But why internal server error!!

dd($this->client->request(strtoupper($method), $this->makeUrl($uri), $this->getOptions($data)));

https://ibb.co/dPztYbj

What could be the problem?

0 likes
2 replies
neilstee's avatar

@nafeeur10 based on your error, there is something wrong with the getimagesize.

Can you expand more the error message?

Also, check the route/controller where you are passing this request in which the getimagesize is having an error.

ab_dev's avatar

Can you enable debug_mode or change env to local and then try requesting. It will show you exact error yo uare facing.

Please or to participate in this conversation.