file_load

  1. drupal
    1. 7
Versions
7 file_load($fid)

Load a file object from the database.

Parameters

$fid A file ID.

Return value

A file object.

See also

hook_file_load()

file_load_multiple()

Related topics

▾ 11 functions call file_load()

file_example_get_managed_file in examples/file_example/file_example.module
Utility function to check for and return a managed file. In this demonstration code we don't necessarily know if a file is managed or not, so often need to check to do the correct behavior. Normal code would not have to do this, as it would be…
file_field_presave in drupal/modules/file/file.field.inc
Implements hook_field_presave().
file_managed_file_process in drupal/modules/file/file.module
Process function to expand the managed_file element type.
file_managed_file_validate in drupal/modules/file/file.module
An #element_validate callback for the managed_file element.
file_managed_file_value in drupal/modules/file/file.module
The #value_callback for a managed_file type element.
hook_field_prepare_view in drupal/modules/field/field.api.php
Prepare field values prior to display.
image_example_style_form in examples/image_example/image_example.pages.inc
Form for uploading and displaying an image using selected style.
image_example_style_form_submit in examples/image_example/image_example.pages.inc
Form Builder; Display a form for uploading an image.
image_field_prepare_view in drupal/modules/image/image.field.inc
Implements hook_field_prepare_view().
system_cron in drupal/modules/system/system.module
Implements hook_cron().
template_preprocess_user_picture in drupal/modules/user/user.module
Process variables for user-picture.tpl.php.

Code

drupal/includes/file.inc, line 553

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