New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-s3-multipsart upload issue #3021
Comments
@mifi do you perhaps know what's going on here? |
Nope,but I could look into it. |
Add the following headers to access-control-allow-headers by default: Authorization, Origin, Content-Type, Accept They are needed for basic operation. See #3021 therefore also remove custom middlewares in examples and standalone
Thanks for providing sample code to reproduce. Because of that I have figured out what is the problem. The problem is that the example code you probably copied from here and based your code on did not contain the correct CORS headers (in this case What you can do to fix this now is to add the following before your app.use((req, res, next) => {
res.setHeader(
'Access-Control-Allow-Headers',
'Authorization, Origin, Content-Type, Accept'
)
next()
}) That should fix it for you. This was a very confusing bug,so I will create a PR to make this header is added by default so this code will not be necessary. |
* refactor cors middleware to avoid duplicates * Make more ACAH headers default Add the following headers to access-control-allow-headers by default: Authorization, Origin, Content-Type, Accept They are needed for basic operation. See #3021 therefore also remove custom middlewares in examples and standalone * Update outdated readme for S3 AWS now requires JSON instead of XML format * Update packages/@uppy/companion/src/server/middlewares.js Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> * Update packages/@uppy/companion/src/server/middlewares.js Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> * fix review comments Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Thank you so much! Debugging is a beast, and your solution works great. |
* refactor cors middleware to avoid duplicates * Make more ACAH headers default Add the following headers to access-control-allow-headers by default: Authorization, Origin, Content-Type, Accept They are needed for basic operation. See transloadit#3021 therefore also remove custom middlewares in examples and standalone * Update outdated readme for S3 AWS now requires JSON instead of XML format * Update packages/@uppy/companion/src/server/middlewares.js Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> * Update packages/@uppy/companion/src/server/middlewares.js Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com> * fix review comments Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Thank you all for this amazing project.
I am trying to setup upload to AWS S3.
Regular uploads work, multipart does not.
Here is my test code (minimized to find issues).
index.js
public/index.html
When I use
const S3 = Uppy.AwsS3
everything works, the file uploads, and the sun shines.When I use
const S3 = Uppy.AwsS3Multipart
I get an errors and it gets all dark and rainy.(After some testing, it seems that
(req, filename, metadata)
is(express request object, undefined and {})
.According to the docs, it should be
(undefined, image.png, {})
When I modify the getkey function to respond with a string, I get the following error.
On the S3 bucket, the CORS headers are:
But I assume that my bucket is setup correctly, because the AWS.S3 upload works.
Is there something else I need to change to get multipart?
The text was updated successfully, but these errors were encountered: