Uploaded August 2025 | Updated September 2026, 20 hours ago
R2 is a zero egress fee S3 compatible object storage solution. It is ideal for large AI training datasets. If you've ever tried to allow your users to upload large datasets via a web browser, you know it can be challenging. Networks can be faulty, and resuming operations is often needed.
Cloudflare Workers are powerful serverless functions, but they are limited to the amount of data that they can pass. A common solution is to use the R2 Multipart Uploads feature. However maintaining state of the upload can be challenging.
This examples, Large Marge, leans on the Actors library to create a new Actor named Uploader. It is used in conjunction with a Hono based API that the front-end interacts with to upload large files.
You can stop and resume file uploading using information stored in a Hono session.
Repo: github.com/craigsdennis/large-marge-r2-actors
Actors: github.com/cloudflare/actors
Multipart Upload API: developers.cloudflare.com/r2/api/workers/workers-multipart-usage
# Chapters
Create an account on Cloudflare today for free: dash.cloudflare.com/sign-up
Calculate your potential savings when switching to R2: https://cfl.re/r2-savings
Tools mentioned:
developers.cloudflare.com
developers.cloudflare.com/workers
developers.cloudflare.com/r2
github.com/cloudflare/actors
Chapters:
00:00 Introducing the large file upload challenge
00:27 Explore R2 Multipart API from Workers Docs
00:45 Durable Object suggestion
01:01 Introducing Actors
01:10 Demo: Large Marge Uploads and Disconnects
02:26 Peep the code
02:38 Hono Sessions Middleware
03:00 Explore the Hono server side API
03:52 Explore the Actor code: Uploader
04:35 Actor instances have SQLite instance && Migrations
05:38 Actors get Remote Procedure Calls, or RPC, stubbed methods
06:10 Deploying your Worker and Actor Code
#cloudflare #cloudflareworkers #developer
R2 is a zero egress fee S3 compatible object storage solution. It is ideal for large AI training datasets. If you've ever tried to allow your users to upload large datasets via a web browser, you know it can be challenging. Networks can be faulty, and resuming operations is often needed.
Cloudflare Workers are powerful serverless functions, but they are limited to the amount of data that they can pass. A common solution is to use the R2 Multipart Uploads feature. However maintaining state of the upload can be challenging.
This examples, Large Marge, leans on the Actors library to create a new Actor named Uploader. It is used in conjunction with a Hono based API that the front-end interacts with to upload large files.
You can stop and resume file uploading using information stored in a Hono session.
Repo: github.com/craigsdennis/large-marge-r2-actors
Actors: github.com/cloudflare/actors
Multipart Upload API: developers.cloudflare.com/r2/api/workers/workers-multipart-usage
# Chapters
Create an account on Cloudflare today for free: dash.cloudflare.com/sign-up
Calculate your potential savings when switching to R2: https://cfl.re/r2-savings
Tools mentioned:
developers.cloudflare.com
developers.cloudflare.com/workers
developers.cloudflare.com/r2
github.com/cloudflare/actors
Chapters:
00:00 Introducing the large file upload challenge
00:27 Explore R2 Multipart API from Workers Docs
00:45 Durable Object suggestion
01:01 Introducing Actors
01:10 Demo: Large Marge Uploads and Disconnects
02:26 Peep the code
02:38 Hono Sessions Middleware
03:00 Explore the Hono server side API
03:52 Explore the Actor code: Uploader
04:35 Actor instances have SQLite instance && Migrations
05:38 Actors get Remote Procedure Calls, or RPC, stubbed methods
06:10 Deploying your Worker and Actor Code
#cloudflare #cloudflareworkers #developer










