I try to upload files/images to s3 files just work fine but Intervention\Images I have trouble
$path = $request->file('file')->store('folder', 's3');
this just works fine it returns the path of the file.
I adjust to policy so the folder is public
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket/*"
}
]
}
but if try to store a Intervention\Image I get an error response from s3,
funny thing is that the image gets uploaded to s3, I just get an error as a response.
$file = request()->file('file');
$fileName = time() . '.' . $file->getClientOriginalExtension();
$image = Image::make($file);
$image->resize(null, 500, function ($constraint) {
$constraint->aspectRatio();
});
$image = $image->stream();
$path = Storage::disk('s3')->put('folder/' . $fileName, $image->__toString(), 'public');
error message looks like
<Error>
<Code>NoSuchKey</Code>
<Message>The resource you requested does not exist</Message>
<RequestId>sdsf2342sdf234</Resource>
<HostId>4442587FB7D0A2F9</RequestId>
</Error>
anybody any idea what i am missing?