A lot of people upgrade to Pro for improved analytics or to get support, but if you dont need those
A lot of people upgrade to Pro for improved analytics or to get support, but if you dont need those its fair enough to stick to free

<form> then you'll probably have to stick with FormData..put's third argument, options, is how you can specify content-type and whatnot to be stored with the object so that they're properly presented when viewed in a public bucket and the like.--data-binary in cURL or just binary in Postman's body options.https://example.com/dog.png and upload it to R2 as dog.png<form>.putcontent-type--data-binarybinaryhttps://example.com/dog.pngdog.pnginterface Environment {
R2: R2Bucket;
}
export default <ExportedHandler<Environment>>{
async fetch(req, env) {
if (req.method !== 'POST') {
return new Response('Method Not Allowed', {
status: 405,
headers: {
Allow: 'POST',
},
});
}
const url = new URL(req.url);
const path = url.pathname.slice(1);
try {
await env.R2.put(path, req.body, {
httpMetadata: req.headers,
});
return new Response(`Successfully uploaded ${path}`);
} catch (e) {
return new Response(`Failed to upload ${path}`, {
status: 500,
});
}
},
};- await env.PROFILE.put('do-something', file);
+ await env.PROFILE.put('do-something', file.stream());