I wonder how many cancel it when their ticket is over
I wonder how many cancel it when their ticket is over
<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

rclone is the way to go - CopyObject can't do cross-account so that's ruled out.--data-binarybinaryhttps://example.com/dog.pngdog.png- await env.PROFILE.put('do-something', file);
+ await env.PROFILE.put('do-something', file.stream());interface 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,
});
}
},
};HTTP GET Output;
<?xml version="1.0" encoding="UTF-8"?><CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedMethod>GET</AllowedMethod><AllowedMethod>HEAD</AllowedMethod>
<AllowedOrigin>*</AllowedOrigin><AllowedHeader>Authorization</AllowedHeader><MaxAgeSeconds>3000</MaxAgeSeconds>
</CORSRule>
</CORSConfiguration>