Using Laravel 8 with Inertia and React.Js
I am bassicly getting this error:
Error executing "PutObject" on "https://hiddenforprivacy.cloudflarestorage.com/hiddenforprivacy/uploads/hiddenforprivacy.png"; AWS HTTP error: cURL error 35: error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://hiddenforprivacy.hiddenforprivacy.r2.cloudflarestorage.com/hiddenforprivacy/uploads/hiddenforprivacy.png
filesystems.php:
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],
'r2' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
/* 'region' => "", */
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
],
],
Controller function:
public function createFotoInit(Request $request)
{
$disk = 'r2';
$validatedData = $request->validate([
'profile_image' => 'nullable|image|mimes:jpeg,png,jpg,heic|max:6048',
]);
if ($request->hasFile('profile_image')) {
$path = Storage::disk($disk)->put('uploads', $request->file('profile_image'));
if ($path) {
return "Path: " . $path;
} else {
return "Failed to upload file.";
}
} else {
return "No file was uploaded.";
}
}