You are here

File interface in Drupal 9

Same name and namespace in other branches
  1. 8 core/includes/file.inc \file
  2. 4 includes/file.inc \file
  3. 5 includes/file.inc \file
  4. 6 includes/file.inc \file
  5. 7 includes/file.inc \file

Common file handling functions.

File

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

Functions

Namesort descending Location Description
file_build_uri Deprecated core/includes/file.inc Constructs a URI to Drupal's default files location given a relative path.
file_create_url Deprecated core/includes/file.inc Creates a web-accessible URL for a stream to an external or local file.
file_get_file_references core/modules/file/file.module Retrieves a list of references to a file.
file_munge_filename Deprecated core/includes/file.inc Modifies a filename as needed for security purposes.
file_unmunge_filename Deprecated core/includes/file.inc Undoes the effect of file_munge_filename().
file_url_transform_relative Deprecated core/includes/file.inc Transforms an absolute URL of a local file to a relative URL.

Constants

Namesort descending Location Description
FILE_STATUS_PERMANENT Deprecated core/includes/file.inc Indicates that the file is permanent and should not be deleted.

Classes

Namesort descending Location Description
File core/modules/file/src/Entity/File.php Defines the file entity class.

Interfaces

Namesort descending Location Description
FileInterface core/modules/file/src/FileInterface.php Defines getter and setter methods for file entity base fields.