DEV Community

loading...

Node.js RestAPIs Download File from Amazon S3 | using Express, AWS-SDK

loizenai profile image loizenai ・2 min read

https://grokonez.com/aws/amazon-s3/node-js-restapis-download-file-from-amazon-s3-using-express-aws-sdk

Node.js RestAPIs Download File from Amazon S3 | using Express, AWS-SDK

In the tutorial, we show how to build a Node.js/Express RestAPIs to Download Files from Amazon S3 using AWS-SDK.

Previous post:

Related posts:
Node.js/Express – PostgreSQL example – Upload File/Download File – Multer + Sequelize CRUD
NodeJS/Express – Bootstrap Image example
Mongoose Many-to-Many related models with NodeJS/Express, MongoDB

Related pages:

Technologies

  • Node.js
  • Express
  • AWS-SDK
  • Amazon S3

Overview

Demo

Goal

We create a Node.js project as below ->

nodejs-express-restapis-download-file-from-amazon-s3-using-aws-sdk-project-structure

Expose a RestAPI: '/api/files/:filename'

File on Amazon S3 ->

nodejs-express-restapis-download-file-from-amazon-s3-using-aws-sdk-file-on-s3-amazon

Download File ->

nodejs-express-restapis-download-file-from-amazon-s3-using-aws-sdk-get-file-successfully

Error ->

nodejs-express-restapis-download-file-from-amazon-s3-using-aws-sdk-get-file-wrong-key-fail

Practice

Setting up Node.js project

Create a folder NodejsDownloadFileAmazonS3, then init Node.js project ->

More at:

https://grokonez.com/aws/amazon-s3/node-js-restapis-download-file-from-amazon-s3-using-express-aws-sdk

Node.js RestAPIs Download File from Amazon S3 | using Express, AWS-SDK

Discussion (0)

Forem Open with the Forem app