Blarep
Blarep

Reputation: 35

Upload an image to AWS S3 from a Mobile app

Im learning about AWS and Flutter to develop a mobile app (Android) like Instagram for a subject in the university.

My question is if there is a way to send an image from the app directly to a S3 Bucket and just store the URL related to that image in DynamoDB.

I’m using Flutter for the frontend (it doesn't use AWS SDK) and to develop the backend AWS Api Gateway (Api REST), Lambda and DynamoDB.

I read that the image can be passed in the request body if it is converted to base64 but I’m worried about if it is the optimal way to do it. I’m thinking that if I pass the image in that way the AWS free tier of Api Gateway and Lambda will be consumed because of the size of the request body that is passed and processed to be saved in a S3 Bucket considering that I will upload several images.

The dimensions of the image will be 1080x1350px so I think the size will be around 500KB and I'm planning to upload videos too.

I will be grateful for any kind of guidance because I am new to AWS.

Upvotes: 2

Views: 788

Answers (1)

Tejaskumar
Tejaskumar

Reputation: 882

You may use S3 presigned url as it will provide scalable solution which will overcome limits imposed by API Gateway. Because video file - particularly HD files, will introduce issues on limit w.r.t API Gateway later on if you pass file directly to API Gateway.

Upvotes: 1

Related Questions