androidnode.jsamazon-s3next.js

Upload video to S3 from Android using Nextjs Backend


This is a very straightforward and simple question. I am writing an API's backend for android app. As usual the android app will call API's that i will deploy on my backend one will be Upload to S3 how what is the best way to get video data from android into my API backend and then upload it to S3. Since this project is in early stages i want best approaches from expert that will be scalable and maintainable in future


Solution

  • The best option is to upload files directly to s3, do not put load on you web servers. When you upload directly to an S3 bucket, you must first request a signed URL from the Amazon S3 service. This is two-step process for your application front end:

    1. Call an Amazon API Gateway endpoint, which invokes the getSignedURL Lambda function or our backend service. This gets a signed URL from the S3 bucket.
    2. Directly upload the file from the frontend application to the S3 bucket.

    enter image description here