Hello All,
In one of my rails app, I want to create public API, where people can upload files.
This web app is hosted on heroku and files are being stored in s3, also maximum file size is 100mb now, which may increase later. So, I have created API as -
1. /get_access_key - this request by client will get it time valid access_key, file upload location and other details.
2. client will use results from step 1 to upload file directly to s3
3. client will be redirected to web app by s3 after upload. Web app will validate recent uploaded file and respond accordingly.
So, it take two request to upload a file to s3 and one more request by client to update text details for uploaded asset.
Problem is - in all it takes 3 https request with this API design to upload file and add text details.
Anybody knows any other better way to do this ?