With a typical web app, you can generate a presigned URL and directly upload to an S3 bucket.

However, if the network is down, the upload fails.

With local first software, we want to support being offline entirely.

Possible Solution

Without network we can:

  1. Save the image as a Blob to indexeddb (localStorage is out because it doesn’t have enough space).

  2. Upload the image once we’re back online, like any other offline change.

In Johannes Schickling’s talk, “The why and how of building a local-first music app”, he describes a similar setup for handling image downloads in an offline friendly way.