not working with lambda function
See original GitHub issueHello i am trying to use node-formidable with aws serverless lambda function but it is giving me ERROR -
req.on is not a function
MY CODE IS ;
var formidable = require("formidable");
const util = require("util");
export async function upload(event, context, callback) {
context.callbackWaitsForEmptyEventLoop = false;
var form = new formidable.IncomingForm();
form.parse(event, function(err, fields, files) {
let response = util.inspect({ fields: fields, files: files });
console.log(response);
});
cc @felixge
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How do I troubleshoot Lambda function failures? - AWS
To troubleshoot Lambda function failures, first determine what's causing the error by using one or more of the AWS services and features ...
Read more >python - Lambda function not working properly - Stack Overflow
The problem with the above approach is that lambda s were created to be nameless. Using a lambda when you ... Just stick...
Read more >My Lambda function is not getting invoked all of a sudden.
My Lambda function is not getting invoked all of a sudden. · First make sure that the IAM Role attached to your Lambda...
Read more >Lambda Troubleshooting - A Cloud Guru
Run one test and check the CloudWatch logs to see which Lambda functions did and did not run. Is something missing, is there...
Read more >Troubleshoot enabling serverless monitoring of AWS Lambda
Solution · Has the Lambda function appeared in the UI before? If so, what is the name of the function? · If some...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Maybe I can help clarify: Lambda/Azure functions receive the raw JSON response without any lifecycle hooks. So in case of multipart/form data the JSON is there ready to parse (with boundaries and/or raw file contents which are usually not base64encoded if multipart but they usually are if it’s a file upload). Does this help?
I am using AWS Serverless and
event
is just likereq
in express framework .