diff --git includes/file.inc includes/file.inc index cccc68d..d58b17f 100644 --- includes/file.inc +++ includes/file.inc @@ -487,17 +487,17 @@ function file_space_used($uid = NULL) { } /** - * Saves a file upload to a new location. The source file is validated as a - * proper upload and handled as such. - * - * The file will be added to the files table as a temporary file. Temporary files - * are periodically cleaned. To make the file permanent file call + * Saves a file upload to a new location. + * + * The source file is validated as a proper upload and handled as such. + * The file will be added to the files table as a temporary file. Temporary + * files are periodically cleaned. To make the file permanent file call * file_set_status() to change its status. * * @param $source * A string specifying the name of the upload field to save. * @param $validators - * An optional, associative array of callback functions used to validate the + * (optional) An associative array of callback functions used to validate the * file. The keys are function names and the values arrays of callback * parameters which will be passed in after the file object. The * functions should return an array of error messages; an empty array @@ -507,9 +507,12 @@ function file_space_used($uid = NULL) { * A string containing the directory $source should be copied to. If this is * not provided or is not writable, the temporary directory will be used. * @param $replace - * A boolean indicating whether an existing file of the same name in the - * destination directory should overwritten. A false value will generate a - * new, unique filename in the destination directory. + * Replace behavior when the destination file already exists: + * - FILE_EXISTS_REPLACE: Replace the existing file. + * - FILE_EXISTS_RENAME: Append _{incrementing number} until the filename + * is unique. + * - FILE_EXISTS_ERROR: Do nothing and return FALSE. + * * @return * An object containing the file information, or 0 in the event of an error. */