Search code examples
flutteramazon-web-servicesamazon-s3aws-lambda

To upload JSON data from flutter app to AWS S3 bucket


I have developed an app while currently sending JSON data to AWS gateway -> AWS lambda, where my API is hosted. However, I got to know about the size limit with Lambda hence I am trying an alternate way to directly upload that JSON data to the AWS S3 bucket in JSON file format and then trigger a Lambda function for that file. However, I was not able to find any solution to upload that data to S3 (tries, AWS amplify, S3 Http etc.) Can anyone please help?


Solution

  • As Anon said, you can generate a PreSigned URL on the backend and send it back to the frontend to upload the file. https://aws.amazon.com/blogs/developer/generate-presigned-url-modular-aws-sdk-javascript/.

    If you want to process that file once it is uploaded you can use S3 Event notifications and react to s3:ObjectCreated:Put. The target of that can be a Lambda function.