Storing Images in S3 from Node Server
Sam Meech-Ward Sam Meech-Ward
120K subscribers
92,095 views
2.6K

 Published On Jul 25, 2022

Learn how to store your web app's files in an s3 bucket. Upload, Download, Update, and Delete images from the s3 bucket.

Uploading an image goes through the express server allowing us to modify the image before it's stored in the s3 bucket. Downloading the image happens directly from the s3 bucket to put less strain on the server and make it easier to integrate our bucket with a CDN in the future.

If you're looking for a next.js specific version, check out:    • Next-Level S3 File Management: The Ul...  

🔗Code:
https://sammeechward.com/storing-imag...

🔗CloudFront CDN:
   • Set up a CloudFront CDN for an S3 Bucket  


Chapters:
0:00​ Intro
3:17 Post a photo with multipart/form-data
5:06 Multer
8:40 Create an S3 Bucket
11:38 IAM User and Policy
16:36 AWS SDK S3 Client
19:00 Uploading an image to S3
22:07 Updating an image
23:18 Random Image Names
25:16 Resizing Images
27:36 Saving data to the database
29:55 Getting images with signed url
35:28 Deleting an image
38:19 Summary

🔗Libraries
Multer: https://www.npmjs.com/package/multer
AWS S3 Client: https://docs.aws.amazon.com/AWSJavaSc...
S3 request presigner: https://docs.aws.amazon.com/AWSJavaSc...



🔗AWS & Cloud Computing tutorials:
Intro to IAM Roles and Policies on AWS:    • Intro to IAM Roles and Policies on AWS  
AWS CLI:    • Setting Up The AWS CLI  
S3 bucket for static website:    • S3 Bucket Hosting a Static Website  


🔗Other tutorials:
Older version of this tutorial:    • Upload Images to S3 from Node Back End  
Upload Images Directly to S3 from Front End:    • Upload Images Directly to S3 from Fro...  
Image upload with mutler without s3: https://sammeechward.com/uploading-im...


🔗Moar Links
My Website: https://www.sammeechward.com
Instagram:   / meech_ward  
Twitter:   / meech_ward  
Github: https://github.com/orgs/Sam-Meech-Ward

show more

Share/Embed