If your experience with uploading files to S3 is anything like mine, you’ll run into a throng of information void of succinct, easy-to-digest code. So, I’ve put together a step-by-step guide that takes you from the browser to S3 using Koa and FormData. Let’s jump in.

Note that this guide will work for any S3 compatible service. That means if you’re using DigitalOcean Spaces, for example, the code also applies to you.

Firstly, we’ll setup our Koa server to send files to S3. This assumes that you already have a node project setup.

  1. Install libraries:
yarn add koa koa-router koa-body…

Stephen Watkins

Software Engineer and Entrepreneur

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store