I'm doing some front-end stuff for a Rails app and I don't get to mess with the backend architecture. Basically, I'm supposed to allow users to upload a file and make that submission essentially go straight to Amazon through a form handled by CarrierWave. If you've ever tried to do this same thing with ajax, you'll know it's virtually impossible.
That puts me here: I need to be able to call .submit() on an html form element and then hook into the progress of the upload as if I were listening for the "progress" event on an XMLHttpRequest.
Forgive me for not showing tons of code. I'm really just looking for two very simple things.
- Is it possible to trap the form's native progress event?
- If so, what's the basic technique? Is it something simple like
form.addEventListener('progress', function () {...})? (<- That doesn't work, by the way.)