“After file loaded” action

I used the send_to_editor method in JavaScript. The end result ended up looking like this:

window.send_to_editor = function(html) { 
        // logic to save via AJAX goes here.
}