Roshan Paudel
Roshan Paudel
CDCloudflare Developers
Created by Roshan Paudel on 3/21/2024 in #general-help
Confused with R2 Pricing
Thank you @Sam @Jaren
4 replies
CDCloudflare Developers
Created by Roshan Paudel on 1/23/2024 in #workers-help
Couldn't solve Blocked by no cors policy.
I am sending fetch request like this :
const page = () => {
const [file, setFile] = useState<File | undefined>();

const submit = async () => {
const res = await fetch(URI, {
method: "PUT",
body: file,
headers: {
"X-Custom-Auth-Key": "dummy",
},
});
console.log(await res.json());
};
return (
<div>
<input
onChange={(e) => {
if (e.target.files) {
setFile(e.target.files[0]);
}
}}
type="file"
/>
<button onClick={submit}>Submit</button>
</div>
);
};
export default page;
const page = () => {
const [file, setFile] = useState<File | undefined>();

const submit = async () => {
const res = await fetch(URI, {
method: "PUT",
body: file,
headers: {
"X-Custom-Auth-Key": "dummy",
},
});
console.log(await res.json());
};
return (
<div>
<input
onChange={(e) => {
if (e.target.files) {
setFile(e.target.files[0]);
}
}}
type="file"
/>
<button onClick={submit}>Submit</button>
</div>
);
};
export default page;
2 replies