Logeshkumar
Logeshkumar

Reputation: 131

Error executing “PutObject” on AWS

I am trying to read .png file from storage path of laravel and upload the same into amazon s3, but i'm getting this below issue:

{ "code": 422, "status": "error", "data": { "exception": "Error executing \"PutObject\" on \"https://s3.amazonaws.com/mrxmms/123/12345_ach.png\"; AWS HTTP error: count(): Parameter must be an array or an object that implements Countable" }, "message": "Unprocessable Entity" }

Here is my sample code:

$dir = storage_path('uploads'); $image_val = $dir. '/' ."product.png";

$image_load = Storage::disk('s3')->put("123/12345.png",file_get_contents($image_val));

Can someone please help me? Thanks in advance!!

Upvotes: 1

Views: 3431

Answers (1)

Florian Dehn
Florian Dehn

Reputation: 11

This issue hit me recently when using Guzzle in version 6.2.1 and AWS SDK in version 3.* Updating Guzzle to 6.3.* solved the issue for me.

composer require guzzlehttp/guzzle:6.3.*

Hope that helps.

Upvotes: 1

Related Questions