March 1, 2023
S3 Storage
This articles demonstrates how to upload files to a Spaces from Digital Ocean.
Requirements
- Digital Ocean account
- Spaces Subsciription
Big Picture
We will implement the file-upload on a ExpressJS server. We’ll use Multer to apply a middleware to get informations about the uploaded file via a form. Then we’ll upload the file with use of the aws-sdk package to Digital Ocean.
Implementation
First, setup the controller for your routes
|
|
Notice that first we bring in the Multer package wich then is applied to the route as a middleware. The document in the brackets is the name of the input field from the form.
|
|