function file_set_status in Drupal 6
Set the status of a file.
Parameters
$file : A Drupal file object.
$status: A status value to set the file to. One of:
Return value
FALSE on failure, TRUE on success and $file->status will contain the status.
Related topics
1 call to file_set_status()
- upload_save in modules/
upload/ upload.module
File
- includes/
file.inc, line 908 - API for handling file uploads and server file management.
Code
function file_set_status(&$file, $status) {
if (db_query('UPDATE {files} SET status = %d WHERE fid = %d', $status, $file->fid)) {
$file->status = $status;
return TRUE;
}
return FALSE;
}