2개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
1
Hello.
I set "acl: "public-read"" when uploading the object, but I don't think the S3 bucket allows "public-read" by default.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/acls.html
ACL must be enabled to allow "public-read".
https://repost.aws/knowledge-center/read-access-objects-s3-bucket
I thought that if you don't need to use "public-read", you can upload by setting "acl" to "private".
https://www.npmjs.com/package/multer-s3
1
Maybe you can use req.file.key
to reference the file stored in S3:
const newDoc = await Model.create({ title: req.body.title, file: req.file.key, // your forgot to use req.file.key (The name of the file) });
Sources:
관련 콘텐츠
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 3년 전