Search code examples
node.jsaws-lambdaaws-api-gateway

how to upload xls/xlsx files using API Gateway and send the file data to the lambda function?


I'm new to lambda and API Gateway. I have done simple things using this services but right now I have a requirement where a user can upload an excel file. The upload process simply triggers an API gateway endpoint which is integrated with a lambda function. I don't want to save the file, I just want to send the file data as CSV/JSON format to my lambda function (nodejs code) and then process/transform/persist the data. Does anybody know how to do it? I've tried a few thing but I am really lost.


Solution

  • As I said in my question I don't need to save the file. I pass the file data through the API Gateway (proxy mode) to the lambda function, parse the data using parse-multipart and parse the parts buffer using node-xlsx to reach to the readable data.