function file_load

file_load($fid)

Loads a single file object from the database.

Parameters

$fid: A file ID.

Return value

An object representing the file, or FALSE if the file was not found.

See also

hook_file_load()

file_load_multiple()

Related topics

File

includes/file.inc, line 580
API for handling file uploads and server file management.

Code

function file_load($fid) {
  $files = file_load_multiple(array($fid), array());
  return reset($files);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!file.inc/function/file_load/7.x