-
I am working on a Node backend and React frontend where I am using multipart upload strategy to upload larger files. I am currently trying to achieve this with The process goes like this
The whole request process, the frontend and backend codes are referenced here in this snippet The bucket policy {
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::my-test-bucket/*"
}
]
} Bucket CORS config [
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"PUT",
"HEAD",
"GET"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": [
"x-amz-server-side-encryption",
"x-amz-request-id",
"x-amz-id-2",
"ETag"
],
"MaxAgeSeconds": 3000
}
] What am I doing wrong here? I have been stuck with this problem for a few days now and am out of ideas as to how to tackle this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
My bad. Turns out I was using the wrong variable name from the request body. I should be using |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
My bad. Turns out I was using the wrong variable name from the request body. I should be using
req.body.parts
instead ofreq.body.partNumber
which I was using in my controller file (not included in the Stackblitz code snippet).