file_save_upload

function file_save_upload

file_save_upload($form_field_name, $validators = array(), $destination = FALSE, $replace = FILE_EXISTS_RENAME)

Saves a file upload to a new location.

The file will be added to the {file_managed} table as a temporary file. Temporary files are periodically cleaned. To make the file a permanent file, assign the status and use file_save() to save the changes.

Parameters

$form_field_name: A string that is the associative array key of the upload form element in the form array.

$validators: An optional, associative array of callback functions used to validate the file. See 登录查看完整内容