Wrangler r2 object put, get, and delete not doing anything locally

I have upload a file using wrangler r2 object put project/test.pdf --file=/Users/me/Downloads/test.pdf --local and it tells me Creating object "test.pdf" in bucket "project". Upload complete.

But then when I run wrangler r2 object get project/test.pdf, it tells me [ERROR] The specified key does not exist.

However when I run the code const listed = await context.env.MY_BUCKET.list(); console.log('Files in bucket:', listed.objects.map(obj => obj.key)); with my wrangler.toml containing [[r2_buckets]] binding = "MY_BUCKET" bucket_name = "project" it does contain test.pdf in the list of files. So how can I fix this?

Note that wrangler r2 object delete project/test.pdf gives me a success code but then the file is still in the list I generate above.
Was this page helpful?