FileUpload to Cloud Flare not working
Hi there,
when I upload to CLoud Flare using S3 and FIleUpload I got following error:
when I use
Every thing works just fine. Any idea how to debug problem on FileUpload.
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your secret access key and signing method.
</Message>
<StringToSign>
AWS4-HMAC-SHA256 ... .../us-east-1/s3/aws4_request ...
</StringToSign>
<StringToSignBytes>
...
</StringToSignBytes>
<CanonicalRequest>
GET /drobny-dev/livewire-tmp/bWuS3qRkVRXKH1TJhYc8DSNLev0zoH-metac3RyaW5nX3ZzX2VudW1zLnBuZw%3D%3D-.png X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=...%2F20241109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=..&X-Amz-Expires=300&X-Amz-SignedHeaders=host%3Bx-amz-acl&x-amz-acl=private host:....r2.cloudflarestorage.com x-amz-acl: host;x-amz-acl UNSIGNED-PAYLOAD
</CanonicalRequest>
<CanonicalRequestBytes>
...
</CanonicalRequestBytes>
<SignatureProvided>
7038c68216cf70246999e947c80e50b184ec300d4984db44b4a8dff7a279623d
</SignatureProvided>
</Error>
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>
The request signature we calculated does not match the signature you provided. Check your secret access key and signing method.
</Message>
<StringToSign>
AWS4-HMAC-SHA256 ... .../us-east-1/s3/aws4_request ...
</StringToSign>
<StringToSignBytes>
...
</StringToSignBytes>
<CanonicalRequest>
GET /drobny-dev/livewire-tmp/bWuS3qRkVRXKH1TJhYc8DSNLev0zoH-metac3RyaW5nX3ZzX2VudW1zLnBuZw%3D%3D-.png X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=...%2F20241109%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=..&X-Amz-Expires=300&X-Amz-SignedHeaders=host%3Bx-amz-acl&x-amz-acl=private host:....r2.cloudflarestorage.com x-amz-acl: host;x-amz-acl UNSIGNED-PAYLOAD
</CanonicalRequest>
<CanonicalRequestBytes>
...
</CanonicalRequestBytes>
<SignatureProvided>
7038c68216cf70246999e947c80e50b184ec300d4984db44b4a8dff7a279623d
</SignatureProvided>
</Error>
Storage::disk("r2")->put("example.txt", "Hello World");
Storage::disk("r2")->put("example.txt", "Hello World");
1 Reply
My FileUpload config:
FileUpload::make('local_image_path')
->label('Image')
->required(fn (string $operation): bool => $operation === 'create')
->live()
->columnSpan(3)
->disk('r2')
->directory('upload_'.config('app.env'))
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
])
->imageResizeMode('cover')
->imageCropAspectRatio('16:9')
->imageResizeTargetWidth('1920')
->imageResizeTargetHeight('1080')
FileUpload::make('local_image_path')
->label('Image')
->required(fn (string $operation): bool => $operation === 'create')
->live()
->columnSpan(3)
->disk('r2')
->directory('upload_'.config('app.env'))
->image()
->imageEditor()
->imageEditorAspectRatios([
'16:9',
'4:3',
])
->imageResizeMode('cover')
->imageCropAspectRatio('16:9')
->imageResizeTargetWidth('1920')
->imageResizeTargetHeight('1080')