Is it possible to upload a file from a web form to S3 through API Gateway? The 'method request' and 'integration request' has no way to configure the file upload. Or there is and I am missing it?
Asked
Active
Viewed 1.0k times
3
-
Realted: https://stackoverflow.com/questions/31645205/how-to-upload-file-to-lambda-function-or-api-gateway – Victor Sergienko Jun 21 '18 at 06:13
1 Answers
8
It's possible to POST binary file uploads through API Gateway. However the binary data is converted to base64 encoded text. This has implications on memory consumption and processing the data. Data has to be processed as a buffer not as a stream.
See the following questions API Gateway file uploads and API Gateway binary data form POST.
Community
- 1
- 1
adamkonrad
- 6,794
- 1
- 34
- 41
-
please check https://aws.amazon.com/about-aws/whats-new/2016/11/binary-data-now-supported-by-api-gateway/ – Sabreena May 02 '17 at 08:03
-
thanks for the heads up, this approach is still not universally suitable for file uploads – adamkonrad May 02 '17 at 15:21
-
-
@Sabreena you can send any content through it, but I'd recommend doing direct S3 upload instead – adamkonrad May 03 '17 at 13:42