Common file handling functions.
Fields on the file object:
Name | Location | Description |
---|---|---|
file_valid_uri |
drupal/ |
Determines whether the URI has a valid scheme for file API operations. |
file_validate_size |
drupal/ |
Checks that the file's size is below certain limits. |
file_validate_name_length |
drupal/ |
Checks for files with names longer than we can store in the database. |
file_validate_is_image |
drupal/ |
Checks that the file is recognized by image_get_info() as an image. |
file_validate_image_resolution |
drupal/ |
Verifies that image dimensions are within the specified maximum and minimum. |
file_validate_extensions |
drupal/ |
Checks that the filename ends with an allowed extension. |
file_validate |
drupal/ |
Checks that a file meets the criteria specified by the validators. |
file_usage_list |
drupal/ |
Determines where a file is used. |
file_usage_delete |
drupal/ |
Removes a record to indicate that a module is no longer using a file. |
file_usage_add |
drupal/ |
Records that a module is using a file. |
file_uri_target |
drupal/ |
Returns the part of a URI after the schema. |
file_uri_scheme |
drupal/ |
Returns the scheme of a URI (e.g. a stream). |
file_upload_max_size |
drupal/ |
Determines the maximum file upload size by querying the PHP settings. |
file_unmunge_filename |
drupal/ |
Undoes the effect of file_munge_filename(). |
file_unmanaged_save_data |
drupal/ |
Saves a string to the specified destination without invoking file API. |
file_unmanaged_move |
drupal/ |
Moves a file to a new location without database changes or hook invocation. |
file_unmanaged_delete_recursive |
drupal/ |
Deletes all files and directories in the specified filepath recursively. |
file_unmanaged_delete |
drupal/ |
Deletes a file without database changes or hook invocations. |
file_unmanaged_copy |
drupal/ |
Copies a file to a new location without invoking the file API. |
file_transfer |
drupal/ |
Transfers a file to the client using HTTP. |
file_stream_wrapper_valid_scheme |
drupal/ |
Checks that the scheme of a stream URI is valid. |
file_stream_wrapper_uri_normalize |
drupal/ |
Normalizes a URI by making it syntactically correct. |
file_stream_wrapper_get_instance_by_uri |
drupal/ |
Returns a reference to the stream wrapper class responsible for a given URI. |
file_stream_wrapper_get_instance_by_scheme |
drupal/ |
Returns a reference to the stream wrapper class responsible for a scheme. |
file_stream_wrapper_get_class |
drupal/ |
Returns the stream wrapper class name for a given scheme. |
file_space_used |
drupal/ |
Determines total disk space used by a single user or the whole filesystem. |
file_scan_directory |
drupal/ |
Finds all files that match a given mask in a given directory. |
file_save_upload |
drupal/ |
Saves a file upload to a new location. |
file_save_data |
drupal/ |
Saves a file to the specified destination and creates a database entry. |
file_save |
drupal/ |
Saves a file object to the database. |
file_prepare_directory |
drupal/ |
Checks that the directory exists and is writable. |
file_munge_filename |
drupal/ |
Modifies a filename as needed for security purposes. |
file_move |
drupal/ |
Moves a file to a new location and update the file's database entry. |
file_load_multiple |
drupal/ |
Loads file objects from the database. |
file_load |
drupal/ |
Loads a single file object from the database. |
file_htaccess_lines |
drupal/ |
Returns the standard .htaccess lines that Drupal writes to file directories. |
file_get_stream_wrappers |
drupal/ |
Provides Drupal stream wrapper registry. |
file_get_mimetype |
drupal/ |
Determines an Internet Media Type or MIME type from a filename. |
file_get_content_headers |
drupal/ |
Examines a file object and returns appropriate content headers for download. |
file_ensure_htaccess |
drupal/ |
Creates a .htaccess file in each Drupal files directory if it is missing. |
file_download_headers |
drupal/ |
Retrieves headers for a private file download. |
file_download_access |
drupal/ |
Checks that the current user has access to a particular file. |
file_download |
drupal/ |
Menu handler for private file transfers. |
file_directory_temp |
drupal/ |
Gets the path of system-appropriate temporary directory. |
file_destination |
drupal/ |
Determines the destination path for a file. |
file_delete |
drupal/ |
Deletes a file and its database record. |
file_default_scheme |
drupal/ |
Gets the default file stream implementation. |
file_create_url |
drupal/ |
Creates a web-accessible URL for a stream to an external or local file. |
file_create_htaccess |
drupal/ |
Creates a .htaccess file in the given directory. |
file_create_filename |
drupal/ |
Creates a full file path from a directory and filename. |
file_copy |
drupal/ |
Copies a file to a new location and adds a file record to the database. |
file_build_uri |
drupal/ |
Constructs a URI to Drupal's default files location given a relative path. |
drupal_unlink |
drupal/ |
Deletes a file. |
drupal_tempnam |
drupal/ |
Creates a file with a unique filename in the specified directory. |
drupal_rmdir |
drupal/ |
Removes a directory. |
drupal_realpath |
drupal/ |
Resolves the absolute filepath of a local URI or filepath. |
drupal_move_uploaded_file |
drupal/ |
Moves an uploaded file to a new location. |
drupal_mkdir |
drupal/ |
Creates a directory using Drupal's default mode. |
drupal_dirname |
drupal/ |
Gets the name of the directory from a given path. |
drupal_chmod |
drupal/ |
Sets the permissions on a file or directory. |
drupal_basename |
drupal/ |
Gets the filename from a given path. |
Name | Location | Description |
---|---|---|
FILE_STATUS_PERMANENT |
drupal/ |
Indicates that the file is permanent and should not be deleted. |
FILE_MODIFY_PERMISSIONS |
drupal/ |
Flag used by file_prepare_directory() -- file permissions may be changed. |
FILE_EXISTS_REPLACE |
drupal/ |
Flag for dealing with existing files: Replace the existing file. |
FILE_EXISTS_RENAME |
drupal/ |
Flag for dealing with existing files: Appends number until name is unique. |
FILE_EXISTS_ERROR |
drupal/ |
Flag for dealing with existing files: Do nothing and return FALSE. |
FILE_CREATE_DIRECTORY |
drupal/ |
Flag used by file_prepare_directory() -- create directory if not present. |