Clarity on "Client Max Upload Size"
Hey everyone, I just wanted to know that how does cf exactly enforce the limit of client max upload size? for example on free tier its 100MB, so does it mean that my user or client cannot upload or share anything above 100MB? for example, If they want to upload a big file (like video or something) on S3 or similar solutions and they couldn't? How could I solve this issue? If I want to build app where client would need share big files.
Help would be really appreciated!
7 Replies
so does it mean that my user or client cannot upload or share anything above 100MB? for exampleyup, because CF buffers the entire upload on edge to prevent some attacks
If they want to upload a big file (like video or something) on S3 or similar solutions and they couldn't?Multipart uploads are what you do, which S3 supports natively, also a good idea so you don't have to retry the entire upload You could also disable proxy/cdn on a subdomain for uploads but would expose you to attacks. Multipart uploads for anything that big isn't a bad idea anyway for the reasons of retries and potentially concurrency S3's kind of a weird example to pick though. If you're using Cloudflare's R2 or Amazon's S3, you can use presigned URLs for uploads (and for multipart) that go directly to R2/S3 (and not through your website) and thus skip that limitation to a degree. Uploading to R2 via Presigned URLs is a 5 GB limit before you have to use multipart
Thanks for the response, things are clear now
Do you have any resources that kind of help or show how multipart uploads work (In area of CF) ? or any kind of tutorial, am pretty new to this
It depends on your origin software more then CF. to CF, it'd just be multiple PUTs or POSTs with different bodies and urls.
Are you using R2? Something other self-hosted software? etc
Yes, I plan to use R2
https://developers.cloudflare.com/r2/api/s3/presigned-urls/
https://developers.cloudflare.com/r2/objects/multipart-objects/
Cloudflare Docs
Presigned URLs · Cloudflare R2 docs
Presigned URLs are an S3 concept ↗ for sharing direct access to your bucket without revealing your token secret. A presigned URL authorizes anyone with the URL to perform an action to the S3 compatibility endpoint for an R2 bucket. By default, the S3 endpoint requires an AUTHORIZATION header signed by your token. Every presigned URL has S3 param...
Cloudflare Docs
Multipart upload · Cloudflare R2 docs
R2 supports S3 API's Multipart Upload ↗ with some limitations.
R2 is all the S3 Protocol, there's lots of libs for the web or for backends that support S3, can use most of them directly with R2 and not think about it too much
Thanks!