© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
Search
Star
Feedback
Setup for Free
Can I write a data URI to an R2 bucket? - Cloudflare Developers
CD
Cloudflare Developers
•
2y ago
•
6 replies
Mitya
Can I write a data URI to an R2 bucket?
Is it possible to write to an R2 bucket with a base64 data URI i
.e
.
await env.r2_pub.put('some/file', 'data:image/png;base64,i5Gkw...');
await env.r2_pub.put('some/file', 'data:image/png;base64,i5Gkw...');
? That fails
(it creates a text file with literally that content
)
, but perhaps there
's a way to encode the file contents first such that R2 accepts it
?
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
86,801
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
upload data to local r2 buckets
CD
Cloudflare Developers / workers-and-pages-help
12mo ago
Write to R2 with ReadableStream
CD
Cloudflare Developers / workers-and-pages-help
3y ago
Upload and save pdfs to a R2 bucket
CD
Cloudflare Developers / workers-and-pages-help
4y ago