How to execute ajax action after image file upload with media widget?
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.