Re:From zero to Production Elixir in 1 month
by pramodliv1 on Sunday July 30, 2017 @06:44PM
(#14888272)
If we want to store the object's URL in a relational database, should the browser send another HTTP request to our service? Wouldn't we lose the object if there's a network error during the interval between the two requests?
[ Parent
| on HN ]
Re:From zero to Production Elixir in 1 month
by aaronds on Sunday July 30, 2017 @07:18PM
(#14888406)
Yes, one option is to do as you've described, for example, use JS to upload the file, then submit a form as normal with a file url / id in the form.
However, you can also create a Lambda that is triggered whenever a file is uploaded to a given bucket and directory. With this, you can react to the file being received and update your database without the need for a second request.