How to rename uploaded file using form API and Drupal managed_file field
Assuming you know about file status, file_save &amp; file_usage_add.

In your submit callback:

$file = file_load($form_state['values']['image_fid']);
$file-&gt;filename = 'somefilename';
$file-&gt;status = FILE_STATUS_PERMANENT;
file_save($file);
file_usage_add($file, 'yourmodule', 'foo', 1);


More info at the Form API Reference.