Scenario
Imagine we are writing a web application with a simple registration page containing something like the following:
- Name
- Password
- Profile Picture
OK, great, next the user hits "Create Profile". Ideally we would like the following to happen..
Our image to be resized on the client (using their cpu)
To post that image right over to S3, into a unique resting place. (without going through our hosting server costing us dyno's and precious time on our over worked single threaded rails app).
To know when our image has been successfully uploaded to S3.
Once the image is safe and sound, submit a second form through to our cloud server with the name, email, password and path to our troublesome image.
Question
Does this approach sound about right?
Also, does anybody know of any examples of how to do this in Rails? Ideally I am trying to find a way to abstract the differences from the user so they only have to hit one save button since that's all they care about.
I have found bits and pieces but nothing that ties it all together.
So far, I have been considering using SwfUpload as outlined in some of these articles...
https://github.com/blueimp/jQuery-File-Upload/wiki/Upload-directly-to-S3
I am a hobbyist at best when it comes to Rails, just wondering if there is a well thought out pattern for this? Everything I have seen so far (as great and helpful as that work is) only seems to get half way there.
I don't know it just feels like I am fighting hard to do something that people must deal with every day during modern development, I feel like I am missing something...