Skip to content
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 uploading files #5

Open
ElectricPulse opened this issue Aug 12, 2024 · 2 comments
Open

AWS uploading files #5

ElectricPulse opened this issue Aug 12, 2024 · 2 comments

Comments

@ElectricPulse
Copy link

What are my options if I want to have a post request with a file attached with AWS? Ideally I want to use something like form-data but with express-form-data that doesn't seem to work.

@H4ad
Copy link
Owner

H4ad commented Aug 12, 2024

From the top of my head, this should work without issues.

The body is encoded in base64 if you enable the binary data (inside AWS), ref: https://stackoverflow.com/a/41770688

Inside the lambda, you will need a lib to parse the form-data to actual data, with express-form-data for example.

In case it didn't work, case a repo with the reproduction and I can take a look

@ElectricPulse
Copy link
Author

The issue ended up being that I used http and not https. Using HTTP returned a rather funny message of 404 status code with the body: Internal Server Error. This could be due to our CDK template, which I don't manage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants