How to override theme_file_widget?
The correct way to override the theme function is:

/**
 * Implements hook_theme_registry_alter().
 */
function mymodule_theme_registry_alter(&amp;$theme_registry) {
  $theme_registry['file_widget']['function'] = 'mymodule_file_widget';
}

function mymodule_file_widget($variables) {
 //your code
}