◉RORK LABJP
●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens●SUBDOMAIN — Rork can now connect your web app to a subdomain only, leaving your root domain and www untouched (12/1)●UPDATES — expo-updates 58.0.23 fixes Android release builds embedding a stale runtime version●FLASH END — Intro pricing for Gemini Flash models ends 12/31, 29 days from now. Time to recheck AI feature costs●HMR — Some report the dev server picking up another server's bundle and then exiting●FIRST VIEW — Map the first screen for a normal launch, a notification, and a link, and back navigation stops surprising you●CARBON — Gemini 4 Carbon and Argon are now at standard rates: $4.00 input, $20.00 output per 1M tokens
Articles/Dev Tools
⬡ Dev Tools/2026-04-25Advanced

Getting a 1GB Video Out of a Rork App Without Losing It — TUS, S3 Multipart, and Background Transfers

A production-ready implementation guide for uploading 1GB+ videos and high-resolution photos from Rork apps. Covers the TUS protocol, S3/R2 Multipart Upload, iOS background transfers, and a resumable progress UI — all with working code.

Rork622file uploadTUSS3 MultipartCloudflare R2background transfer

✦ Premium Article

I've simulated a train ride on a 200MB video upload by flipping airplane mode on for ten seconds. The progress bar went from about 80% straight back to 0%. A single-shot fetch + FormData upload throws away everything it has sent the moment the connection drops. It had passed every test on my desk Wi-Fi, which is exactly why the result stung.

Large uploads rarely fail because the server falls over. They fail where the assumptions of mobile — connections drop, the OS suspends you, memory runs out — collide with a naive implementation. This guide writes down the implementation that closes that gap, with code you can run.

The thing I'd like you to take away first: the biggest win isn't chunking itself, it's keeping a record of "how far did it get" on both the device and the server.

Why "just fetch + FormData" breaks in production

If you design mobile file uploads the same way you'd design a browser upload, you'll walk straight into four walls.

① Network interruptions are the default, not the exception. Train gaps, underground malls, elevators, and handoffs between Wi-Fi and cellular all kill the TCP connection. A single-shot upload has to restart from zero every time. If you're 95% through a 1GB file when it drops, you just wasted 950MB.

② iOS will kill your background process without mercy. Even if the user doesn't force-quit the app, a standard URLSession stops sending after roughly 30 seconds in the background. Unless you reach for BGTaskScheduler or NSURLSession.background, the notion that your upload "keeps going in the background" is a fantasy.

③ Memory constraints are tight. readAsDataURL on a 1GB file will crash. Usable foreground memory varies a lot by device, and any design that loads the whole file into memory is one to avoid from the start.

④ Servers have limits too. Most PaaS platforms cap request bodies: Cloudflare Workers at 100MB (Free / Pro plans), Vercel Serverless at 4.5MB by default, Lambda behind API Gateway at 10MB. A single POST isn't going to clear those gates.

The design that addresses all four simultaneously is a resumable + chunked + background-capable upload foundation.

Three options to compare — which one to pick

There are three practical ways to do resumable, chunked transfers. Each has its sweet spot.

  • TUS protocol (tus.io): An open, HTTP-based standard. Client libraries exist in most languages, and the server side runs as either OSS (tusd) or Supabase Storage / Uppy Companion. Arbitrary chunk sizes, resume, and parallelism are all handled by the spec. The generalist choice.
  • S3 / R2 Multipart Upload: AWS's official protocol, supported by Cloudflare R2, MinIO, and other S3-compatible storage. Parts range from 5MiB to 5GiB (only the last part may be smaller), with up to 10,000 parts per upload; on R2 the combined object can be just under 5TiB. The right call when you're writing directly to cloud storage.
  • Supabase Storage Resumable Upload: Supabase's storage layer speaks TUS under the hood, so you get resumable upload in a few lines from the JS client. The fastest path if you're already on Supabase.

My personal decision tree is straightforward: Cloudflare R2 as storage → Multipart Upload, Supabase backend → Supabase Storage Resumable, own API server handling files → TUS. When in doubt, work down that list.

Here is how they differ in where the resume record lives and what they ask of the device:

ApproachResume source of truthLoad on the deviceWhat the server needs
TUSThe server's Upload-Offset (asked via HEAD)Depends on how the client reads the input fileA TUS server such as tusd
S3 / R2 MultipartThe uploadId and the ETags of finished parts, stored on the deviceSmall — it reads one part at a timeFour endpoints: start, sign, complete, abort
Supabase ResumableSame as TUSSame as TUSSupabase Storage only

Only Multipart keeps the resume record on the device. That is why the code below spends so many lines persisting the uploadId and ETags.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You'll gain a resumable upload foundation that handles 1GB videos across network drops and app terminations — the failure mode that breaks user trust
✦You'll learn when to pick TUS vs S3 Multipart Upload vs Cloudflare R2, with production-ready client code for each path
✦You'll be able to ship background uploads with a progress UI that completes even when users leave the app
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Rork Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⬡ Dev Tools2026-11-19
New Wallpapers Showed Up Everywhere Except the Filters: Ship the Count and the Category Lists Together
I added 67 wallpapers in one batch. They appeared in the full list and in New, but not under a single category filter, because I had raised the ID limit and forgotten to ship the category lists. Here is a pre-bump check, a client-side way to spot silent fallbacks in an Expo app, and a post-release count against the origin.
⬡ Dev Tools2026-11-04
Catching the Few Seconds Before Streaming Audio Starts: A Loading State and a Timeout
You tap play and nothing happens for a moment. Here is how I model that gap with expo-audio: a requested flag, a 400ms delayed spinner, and an 8-second timeout.
⬡ Dev Tools2026-10-30
It runs in development but the iOS Release build dies on launch — checking whether a missing scheme is the cause
In an expo-router app, an app.json with no scheme can crash only the iOS Release build at launch. A triage table for Release-only crashes, how to read the reason from the log, why Debug and Android survive, the two fixes and why one needs a native rebuild, and a pre-submission check.