File interface
Common file handling functions.
File
- 
              core/
includes/ file.inc, line 40  
Functions
| Title Sort descending | Deprecated | File name | Summary | 
|---|---|---|---|
| drupal_basename | Deprecated | core/ | 
                                                                                        Gets the filename from a given path. | 
| drupal_chmod | Deprecated | core/ | 
                                                                                        Sets the permissions on a file or directory. | 
| drupal_dirname | Deprecated | core/ | 
                                                                                        Gets the name of the directory from a given path. | 
| drupal_mkdir | Deprecated | core/ | 
                                                                                        Creates a directory, optionally creating missing components in the path to the directory.  | 
              
| drupal_move_uploaded_file | Deprecated | core/ | 
                                                                                        Moves an uploaded file to a new location. | 
| drupal_realpath | Deprecated | core/ | 
                                                                                        Resolves the absolute filepath of a local URI or filepath. | 
| drupal_rmdir | Deprecated | core/ | 
                                                                                        Removes a directory. | 
| drupal_tempnam | Deprecated | core/ | 
                                                                                        Creates a file with a unique filename in the specified directory. | 
| drupal_unlink | Deprecated | core/ | 
                                                                                        Deletes a file. | 
| file_build_uri | core/ | 
                                                                                        Constructs a URI to Drupal's default files location given a relative path. | |
| file_create_filename | Deprecated | core/ | 
                                                                                        Creates a full file path from a directory and filename. | 
| file_create_url | core/ | 
                                                                                        Creates a web-accessible URL for a stream to an external or local file. | |
| file_default_scheme | Deprecated | core/ | 
                                                                                        Gets the default file stream implementation. | 
| file_delete | Deprecated | core/ | 
                                                                                        Deletes a file and its database record. | 
| file_delete_multiple | Deprecated | core/ | 
                                                                                        Deletes files. | 
| file_destination | Deprecated | core/ | 
                                                                                        Determines the destination path for a file. | 
| file_directory_os_temp | Deprecated | core/ | 
                                                                                        Discovers a writable system-appropriate temporary directory. | 
| file_directory_temp | Deprecated | core/ | 
                                                                                        Gets and sets the path of the configured temporary directory. | 
| file_ensure_htaccess | Deprecated | core/ | 
                                                                                        Creates a .htaccess file in each Drupal files directory if it is missing. | 
| file_get_file_references | core/ | 
                                                                                        Retrieves a list of references to a file. | |
| file_htaccess_lines | Deprecated | core/ | 
                                                                                        Returns the standard .htaccess lines that Drupal writes to file directories. | 
| file_munge_filename | core/ | 
                                                                                        Modifies a filename as needed for security purposes. | |
| file_prepare_directory | Deprecated | core/ | 
                                                                                        Checks that the directory exists and is writable. | 
| file_save_htaccess | Deprecated | core/ | 
                                                                                        Creates a .htaccess file in the given directory. | 
| file_scan_directory | Deprecated | core/ | 
                                                                                        Finds all files that match a given mask in a given directory. | 
| file_stream_wrapper_uri_normalize | Deprecated | core/ | 
                                                                                        Normalizes a URI by making it syntactically correct. | 
| file_stream_wrapper_valid_scheme | Deprecated | core/ | 
                                                                                        Checks that the scheme of a stream URI is valid. | 
| file_unmanaged_copy | Deprecated | core/ | 
                                                                                        Copies a file to a new location without database changes or hook invocation. | 
| file_unmanaged_delete | Deprecated | core/ | 
                                                                                        Deletes a file without database changes or hook invocations. | 
| file_unmanaged_delete_recursive | Deprecated | core/ | 
                                                                                        Deletes all files and directories in the specified filepath recursively. | 
| file_unmanaged_move | Deprecated | core/ | 
                                                                                        Moves a file to a new location without database changes or hook invocation. | 
| file_unmanaged_prepare | Deprecated | core/ | 
                                                                                        Internal function that prepares the destination for a file_unmanaged_copy or file_unmanaged_move operation.  | 
              
| file_unmanaged_save_data | Deprecated | core/ | 
                                                                                        Saves a file to the specified destination without invoking file API. | 
| file_unmunge_filename | core/ | 
                                                                                        Undoes the effect of file_munge_filename(). | |
| file_upload_max_size | Deprecated | core/ | 
                                                                                        Determines the maximum file upload size by querying the PHP settings. | 
| file_uri_scheme | Deprecated | core/ | 
                                                                                        Returns the scheme of a URI (e.g. a stream). | 
| file_uri_target | Deprecated | core/ | 
                                                                                        Returns the part of a URI after the schema. | 
| file_url_transform_relative | core/ | 
                                                                                        Transforms an absolute URL of a local file to a relative URL. | |
| file_valid_uri | Deprecated | core/ | 
                                                                                        Determines whether the URI has a valid scheme for file API operations. | 
Constants
| Title Sort descending | Deprecated | File name | Summary | 
|---|---|---|---|
| FILE_CREATE_DIRECTORY | Deprecated | core/ | 
                                                                                        Flag used to create a directory if not present. | 
| FILE_EXISTS_ERROR | Deprecated | core/ | 
                                                                                        Flag for dealing with existing files: Do nothing and return FALSE. | 
| FILE_EXISTS_RENAME | Deprecated | core/ | 
                                                                                        Flag for dealing with existing files: Appends number until name is unique. | 
| FILE_EXISTS_REPLACE | Deprecated | core/ | 
                                                                                        Flag for dealing with existing files: Replace the existing file. | 
| FILE_MODIFY_PERMISSIONS | Deprecated | core/ | 
                                                                                        Flag used to indicate file permissions may be changed. | 
| FILE_STATUS_PERMANENT | core/ | 
                                                                                        Indicates that the file is permanent and should not be deleted. | 
Classes
| Title Sort descending | File name | Summary | 
|---|---|---|
| File | core/ | 
                                                                                        Defines the file entity class. | 
Interfaces
| Title Sort descending | File name | Summary | 
|---|---|---|
| FileInterface | core/ | 
                                                                                        Defines getter and setter methods for file entity base fields. | 
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.