Metadata not being inserted - R2 Presigned URLs
hello, i've included metadata during the url presigning, but the uploaded file doesn't have custom metadata on r2 dashboard
e.g of presigned url
const command = new PutObjectCommand({
Bucket: ENV_VARIABLES.R2.R2_BUCKET_NAME,
Key: key,
ContentLength: fileSizeInBytes,
ContentType: contentType,
ContentMD5: md5_checksum,
CacheControl: "private, max-age=2592000", // 30 days
Metadata: {
"userr": "userr"
}
});
return await getSignedUrl(FileStorage._s3Client, command, { expiresIn: expiresInSeconds }); const command = new PutObjectCommand({
Bucket: ENV_VARIABLES.R2.R2_BUCKET_NAME,
Key: key,
ContentLength: fileSizeInBytes,
ContentType: contentType,
ContentMD5: md5_checksum,
CacheControl: "private, max-age=2592000", // 30 days
Metadata: {
"userr": "userr"
}
});
return await getSignedUrl(FileStorage._s3Client, command, { expiresIn: expiresInSeconds });e.g of presigned url
https://xxxx.xxxx.r2.cloudflarestorage.com/user%20b/testt.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=35f5366333f47becddfdad106108c512%2F20240821%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20240821T081129Z&X-Amz-Expires=600&X-Amz-Signature=27c05c8c21582732108d5caee42cbcbba1f43068547655729041445ad0509248&X-Amz-SignedHeaders=content-length%3Bcontent-md5%3Bhost&x-amz-meta-userr=userr&x-id=PutObjecthttps://xxxx.xxxx.r2.cloudflarestorage.com/user%20b/testt.txt?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Credential=35f5366333f47becddfdad106108c512%2F20240821%2Fauto%2Fs3%2Faws4_request&X-Amz-Date=20240821T081129Z&X-Amz-Expires=600&X-Amz-Signature=27c05c8c21582732108d5caee42cbcbba1f43068547655729041445ad0509248&X-Amz-SignedHeaders=content-length%3Bcontent-md5%3Bhost&x-amz-meta-userr=userr&x-id=PutObject