Index: includes/form.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/form.inc,v retrieving revision 1.267 diff -u -r1.267 form.inc --- includes/form.inc 12 Feb 2008 13:52:32 -0000 1.267 +++ includes/form.inc 17 Feb 2008 11:09:12 -0000 @@ -1250,6 +1250,20 @@ } /** + * Helper function to determine the value for a file field element. + */ +function form_type_file_value($form, $edit = FALSE) { + if ($edit !== FALSE) { + // Retrieve the name of the file field. + $name = substr($form['#name'], 6, -1); + + // Save the file and return false when it fails. + $file = file_save_upload($name); + return $file === 0 ? FALSE : $file; + } +} + +/** * Helper function to determine the value for form's token value. * * @param $form