Skip to main content

Overview

Launch includes a production-ready file upload system that supports:
  • Secure uploads via S3 presigned URLs (no credentials exposed to client)
  • Resumable multipart uploads for large files
  • Native background uploads for iOS/Android (survives app backgrounding)
  • Parallel uploads for multiple files
  • Progress tracking with persistence across navigation

Prerequisites

  • S3 bucket and credentials
  • Backend running with S3 env vars (copy from apps/api/example.env)
  • File uploads feature enabled in apps/mobile/features/feature-registry.tsx

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                        Upload Flow                               │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│   Mobile App                    Backend API              AWS S3  │
│   ──────────                    ───────────              ──────  │
│                                                                  │
│   1. Select file ──────────────►                                 │
│                                                                  │
│   2. Request URL ──────────────► Validate user                   │
│                                  Check quota                     │
│                                  Generate presigned URL ◄──────► │
│                    ◄──────────── Return URL                      │
│                                                                  │
│   3. Upload file ──────────────────────────────────────────────► │
│                                                                  │
│   4. Confirm ──────────────────► Mark as uploaded                │
│                                  Update user storage             │
│                    ◄──────────── Success                         │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Upload Strategies

Launch automatically selects the best upload strategy based on file size:
File SizeStrategyDescription
< 10 MBSimple UploadSingle presigned URL PUT request
10-40 MBMultipart UploadChunked upload with 5MB parts, resumable
> 40 MBNative BackgroundiOS URLSession / Android coroutines

Features

Presigned URLs

Secure, time-limited URLs. No S3 credentials on client.

Resumable

Multipart uploads can resume after network interruption.

Background Uploads

Native iOS/Android uploads continue when app is backgrounded.

Progress Tracking

Per-file progress with UI persistence across navigation.

Steps

  1. Configure S3 and backend env vars: Backend Setup
  2. Integrate the mobile UI: Mobile Setup
  3. Enable the feature flag:
apps/mobile/features/feature-registry.tsxfeatureFlags.fileUploads = true

How It Works

  • Mobile requests presigned URLs from the API
  • Uploads go directly to S3
  • The API confirms and records uploads

Test Checklist

  • Select a photo and upload successfully
  • Large file triggers multipart or native upload
  • Uploaded file appears in the list

Troubleshooting

Start with Troubleshooting and verify S3 credentials and CORS configuration.

Remove / Disable

To disable uploads while you configure S3, set: apps/mobile/features/feature-registry.tsxfeatureFlags.fileUploads = false For production removal guidance, see Removing Features.

Next Steps