How do I get object metadata within a Worker for an uploaded object?

I'm currently using a Cloudflare Worker to forward uploaded object data to a job scheduler, and I'm unsure how to access the metadata of the uploaded object.
async queue(batch: MessageBatch<Error>, env: Env): Promise<void> {
console.log('Received batch:', batch.messages);
},
async queue(batch: MessageBatch<Error>, env: Env): Promise<void> {
console.log('Received batch:', batch.messages);
},
Each message has the following structure:
{
attempts: 1,
body: {
account: "",
bucket: "",
eventTime: "2025-04-28T19:34:47.515Z",
action: "PutObject",
object: {
key: "",
size: 3794459,
eTag: "",
},
},
timestamp: "2025-04-28T19:34:47.780Z",
id: "",
}
{
attempts: 1,
body: {
account: "",
bucket: "",
eventTime: "2025-04-28T19:34:47.515Z",
action: "PutObject",
object: {
key: "",
size: 3794459,
eTag: "",
},
},
timestamp: "2025-04-28T19:34:47.780Z",
id: "",
}
However, I'm curious why the object metadata is not included here. How can I access these values? The following docs page isn't so understandable to me and doesn't seem relevant in this case: https://developers.cloudflare.com/cloudflare-for-platforms/cloudflare-for-saas/domain-support/custom-metadata/#:~:text=within%2030%20seconds.-,Accessing%20custom%20metadata%20from%20a%20Cloudflare%20Worker,on%20it%20using%20the%20Worker.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?