file_set_status

Versions
6
file_set_status(&$file, $status)

Set the status of a file.

Parameters

file A Drupal file object

status A status value to set the file to.

Return value

FALSE on failure, TRUE on success and $file->status will contain the status.

Related topics

Code

includes/file.inc, line 785

<?php
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;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.