I\'m try to upload file from iOS to AWS API Gateway and passthrough it to Lambda function, How can I implement this scenario?
I can use multipart/form-data
I'd highly recommend using direct S3 upload using one of the AWS SDKs. AWS Lambda is suited to process just short 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.
If want to upload file through lambda, one way is to open your AWS API Gateway console.
Go to
"API" -> {YourAPI} -> "Settings"
There you will find "Binary Media Types" section.
Add following media type:
multipart/form-data
Save your changes.
Then Go to "Resources" -> "proxy method"(eg. "ANY") -> "Method Request" -> "HTTP Request Headers" and add following headers "Content-Type", "Accept".
Finally deploy your api.
For more info visit: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings-configure-with-console.html
API Gateway has added support for an S3 Proxy. This allows you to expose file uploading directly to S3.
http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html