Is there a callback for the managed_file form element, called on succesful upload? Is there a Javascript/PHP callback for the managed_file form element that is invoked when the file is successfully uploaded? (I mean when the "Upload" button is clicked, not when the form is submitted.)

$form['video'] = array(
    '#title' =&gt; t('Video'),
    '#type' =&gt; 'managed_file',
    '#default_value' =&gt; variable_get('image_example_image_fid', ''),
    '#upload_location' =&gt; 'public://temp_managed/',
);  


I have tried:


#file_value_callbacks, but this seems to be a preprocess
#process, but it also seems to happen during the page load
For the PHP side, use #upload_validators as described in Form API docs. They are fired after upload, just like you want them to be. In Drupal everything that's supposed to happen between user's input and actual form save, happens in validators. Pretty weird, but that's the way it is.

For an JavaScript part, element's description says:


  The #managed_file element is expanded into a set of FAPI elements including two '#submit' buttons one for Upload one for Remove, a '#file' element and a handful of '#hidden' and '#markup' elements to handle progress indication and displaying of already uploaded files.


Thus, while it does not have any '#ajax' property, you can try to access it's internals with your own custom code. Notably, successful file upload makes delete button visible. But internals can be refactored without notice, so be careful about that.