How to upload a zipfile to R2?
I'm trying to upload a zipfile to R2.
My worker receives the zip file as formdata:
then I get the file inside formData:
and
also, I've tried
but it gives the following error:
Can anyone help me with this? What am I doing wrong?
My worker receives the zip file as formdata:
const formData = await req.formData();then I get the file inside formData:
const file = formData.get('file');and
put it in R2await env.MODELS_BUCKET.put(file);also, I've tried
await env.MODELS_BUCKET.put(file.stream());but it gives the following error:
Can anyone help me with this? What am I doing wrong?