How to execute ajax action after image file upload with media widget? I want to prepopulate some node fields with image metadata (using the EXIF module) right after an image is uploaded/inserted in a node image field with media browser widget and before the node is being saved.

By default, the EXIF module updates the node fields with image metadata after the node is being saved. But, ideally, I would like to hook into the file upload process and update the node fields instantly with ajax, so that users can preview and even edit the metadata related fields.
If I understand your question correctly, I believe you can do this with hook_form_alter. You can create a new form submit handler to do anything you want to do the data before it's saved. I'm not sure why you would need ajax. 

my_module_form_alter(&amp;$form, &amp;$form_state, $form_id){
    $form['#submit'] = array();
    $form['#submit'][] = 'my_module_submit_handler';
//this makes sure your submit handler is run first
     array_unshift($form['#submit'], 'my_module_submit_handler');
}


Then create a function to make your changes and call the original form submit function... 

function my_module_submit_handler($form_id, &amp;$form_state){
     /* 
       changes to the values submitted to your form
     */
   }


This is off the top of my head but should put you on the correct path. I believe that your handler will execute and then the default handler will execute.