Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload file to lambda function or API Gateway?

I'm trying to upload a file from iOS to AWS API Gateway and pass it through to a Lambda function, How can I implement this scenario?

I can use multipart/form-data to upload to AWS API Gateway but how make input Model support binary data?

[Edit1] moved from answer by Spektre

Thanks For response, after a little of reading I figure out that's no way to upload file to lambda (and it's not logical because it's event based) and the only valid use case to upload to S3 and make S3 notify lambda.

like image 691
Henawey Avatar asked Jul 27 '15 04:07

Henawey


People also ask

Can Lambda upload file to S3?

Amazon S3 service is used for file storage, where you can upload or remove files. We can trigger AWS Lambda on S3 when there are any file uploads in S3 buckets. AWS Lambda has a handler function which acts as a start point for AWS Lambda function.


1 Answers

I'd highly recommend using direct S3 upload using one of the AWS SDKs. AWS Lambda is best suited for processing events, not content transfers like uploads. You can check its billing and limits to make a more informed decision on if it's really something you're looking for.

like image 122
adamkonrad Avatar answered Sep 27 '22 20:09

adamkonrad