Hi Folks, is there any working example for using R2 and presigned url in local development (wrangler
Hi Folks, is there any working example for using R2 and presigned url in local development (wrangler)?

storage::s3: Error getting object: ErrGetObject(Unhandled(Unhandled { source: ErrorMetadata { code: Some("NoSuchBucket"), message: Some("The specified bucket does not exist."), extras: None }, meta: ErrorMetadata { code: Some("NoSuchBucket"), message: Some("The specified bucket does not exist."), extras: None } }))
weur but maybe I should use eeur?The region name 'eu-central-1' is not valid. Must be one of: wnam, enam, weur, eeur, apac, auto"https://<hidden>.eu.r2.cloudflarestorage.com/rsmono-developS3_URL and one called S3_STORAGE_BUCKET so since the bucket name is in the url I don't know what to do and what I tried so far return NoSuchBucketAlertReceived(HandshakeFailure). What does that indicate?storage::s3: Error getting object: ErrGetObject(Unhandled(Unhandled { source: ErrorMetadata { code: Some("NoSuchBucket"), message: Some("The specified bucket does not exist."), extras: None }, meta: ErrorMetadata { code: Some("NoSuchBucket"), message: Some("The specified bucket does not exist."), extras: None } }))export const getAttachmentFile = async (c: Context) => {
const bucket: R2Bucket = c.env.BUCKET;
const { messageId, hash, name } = c.req.param();
const key = `attachments/${messageId}/${hash}/${name}`;
const file = await bucket.get(key);
if(!file) throw new ServerError("file not found", 404);
const headers = new Headers();
headers.set("Cache-Control", "public, max-age=86400");
if(file.httpMetadata?.contentType) headers.set("Content-Type" file.httpMetadata.contentType);
return new Response(file.body, {status: 200, headers});
}