How to override theme_file_widget? Is there any method to override this function theme_file_widget.

I tried to to do the following in my module.

function mymodule_file_widget($variables)

and also in my theme

function mytheme_file_widget($variables)

but did not work. I cleared the cache also. Is there any method to override this function?
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
}