const response = await fetch(signedUrl, { method: "PUT", headers: { "x-amz-meta-name": "name", "Content-Length": String(fileSize), "Content-Type": fileType, }, body: file, });
const cmd = new PutObjectCommand({ Bucket, Key, ContentLength: fileSize, ContentType: fileType, }); const signedUrl = await getSignedUrl(r2Client, cmd);
[ { "AllowedOrigins": [ "*" ], "AllowedMethods": [ "GET", "PUT", "POST", "DELETE" ], "AllowedHeaders": [ "*" ], "ExposeHeaders": [], "MaxAgeSeconds": 3000 }]