In the "old days" we uploaded files to our webserver and then sent them on to S3. The AWS-SDK has the ability to generate a signed link that our back-end, Expressjs/Nodejs, can send to the browser. The front-end then takes the file and sends it directly to S3. This is awesome! It cuts out the processing, disk space, and bandwidth required when using Express as a middleman. With this approach, you can safely, and securely, give the user a much better/faster experience.
github link - https://github.com/robertbunch/fileFr...
Udemy Express Course link w/coupon- https://www.udemy.com/course/just-exp...
Chapters:
0:00 How This Works (Drawing)
4:55 Steps
7:56 Final Demo and Repo
11:42 File(s)/File Structure and Purpose
12:24 index.html
16:17 Build Express Server/Router
20:44 Scripts.js - file & form handler
26:02 /get-put-link Express Route
33:08 aws-sdk module
35:36 Setup AWS credentials & config.js
getS3PutLink function
35:36 Bucket Setup
42:33 getS3PutLink function - s3 object
47:13 getS3PutLink function - s3 getSignedUrl
50:47 Finish Express Route Response
54:00 Show ProgressBar & Handle !200
56:31 Try/Catch Upload File To S3
60:50 CORS (S3)
64:08 Finish ProgressBar
67:47 Request getSignedLink from Express
70:16 /finalize-upload Express Route
72:23 getS3SignedLink function
76:22 Put Image In HTML (Extra)
78:38 Demo Deleted AccessKey
Смотрите видео Upload a File Directly To S3 From The Browser (w/Express.js Help) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Good Morning Developers 21 Ноябрь 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 412 раз и оно понравилось 10 людям.