Common file handling functions.
Fields on the file object:
| Name | Location | Description |
|---|---|---|
| FILE_CREATE_DIRECTORY | drupal-cvs/includes/file.inc | Flag used by file_check_directory() -- create directory if not present. |
| FILE_DOWNLOADS_PRIVATE | drupal-cvs/includes/file.inc | Flag to indicate that the 'private' file download method is enabled. |
| FILE_DOWNLOADS_PUBLIC | drupal-cvs/includes/file.inc | Flag to indicate that the 'public' file download method is enabled. |
| FILE_EXISTS_ERROR | drupal-cvs/includes/file.inc | Flag for dealing with existing files: Do nothing and return FALSE. |
| FILE_EXISTS_RENAME | drupal-cvs/includes/file.inc | Flag for dealing with existing files: Appends number until name is unique. |
| FILE_EXISTS_REPLACE | drupal-cvs/includes/file.inc | Flag for dealing with existing files: Replace the existing file. |
| FILE_MODIFY_PERMISSIONS | drupal-cvs/includes/file.inc | Flag used by file_check_directory() -- file permissions may be changed. |
| FILE_STATUS_PERMANENT | drupal-cvs/includes/file.inc | File status -- File has been permanently saved to the {files} tables. |
| FILE_STATUS_TEMPORARY | drupal-cvs/includes/file.inc | File status -- File has been temporarily saved to the {files} tables. |
| Name | Location | Description |
|---|---|---|
| file_check_directory | drupal-cvs/includes/file.inc | Check that the directory exists and is writable. |
| file_check_location | drupal-cvs/includes/file.inc | Check if a file is really located inside $directory. |
| file_check_path | drupal-cvs/includes/file.inc | Checks path to see if it is a directory, or a directory/file. |
| file_copy | drupal-cvs/includes/file.inc | Copy a file to a new location and adds a file record to the database. |
| file_create_filename | drupal-cvs/includes/file.inc | Create a full file path from a directory and filename. |
| file_create_path | drupal-cvs/includes/file.inc | Make sure the destination is a complete path and resides in the file system directory, if it is not prepend the file system directory. |
| file_create_url | drupal-cvs/includes/file.inc | Create the download path to a file. |
| file_delete | drupal-cvs/includes/file.inc | Delete a file and its database record. |
| file_destination | drupal-cvs/includes/file.inc | Determines the destination path for a file depending on how replacement of existing files should be handled. |
| file_directory_path | drupal-cvs/includes/file.inc | Determine the default 'files' directory. |
| file_directory_temp | drupal-cvs/includes/file.inc | Determine the default temporary directory. |
| file_download | drupal-cvs/includes/file.inc | Menu handler for private file transfers. |
| file_get_mimetype | drupal-cvs/includes/file.inc | Determine an Internet Media Type, or MIME type from a filename. |
| file_load | drupal-cvs/includes/file.inc | Load a file object from the database. |
| file_move | drupal-cvs/includes/file.inc | Move a file to a new location and update the file's database entry. |
| file_munge_filename | drupal-cvs/includes/file.inc | Munge the filename as needed for security purposes. |
| file_save | drupal-cvs/includes/file.inc | Save a file object to the database. |
| file_save_data | drupal-cvs/includes/file.inc | Save a string to the specified destination and create a database file entry. |
| file_save_upload | drupal-cvs/includes/file.inc | Saves a file upload to a new location. |
| file_scan_directory | drupal-cvs/includes/file.inc | Finds all files that match a given mask in a given directory. |
| file_space_used | drupal-cvs/includes/file.inc | Determine total disk space used by a single user or the whole filesystem. |
| file_transfer | drupal-cvs/includes/file.inc | Transfer file using HTTP to client. Pipes a file through Drupal to the client. |
| file_unmanaged_copy | drupal-cvs/includes/file.inc | Copy a file to a new location without calling any hooks or making any changes to the database. |
| file_unmanaged_delete | drupal-cvs/includes/file.inc | Delete a file without calling any hooks or making any changes to the database. |
| file_unmanaged_move | drupal-cvs/includes/file.inc | Move a file to a new location without calling any hooks or making any changes to the database. |
| file_unmanaged_save_data | drupal-cvs/includes/file.inc | Save a string to the specified destination without calling any hooks or making any changes to the database. |
| file_unmunge_filename | drupal-cvs/includes/file.inc | Undo the effect of upload_munge_filename(). |
| file_upload_max_size | drupal-cvs/includes/file.inc | Determine the maximum file upload size by querying the PHP settings. |
| file_validate | drupal-cvs/includes/file.inc | Check that a file meets the criteria specified by the validators. |
| file_validate_extensions | drupal-cvs/includes/file.inc | Check that the filename ends with an allowed extension. |
| file_validate_image_resolution | drupal-cvs/includes/file.inc | If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions. |
| file_validate_is_image | drupal-cvs/includes/file.inc | Check that the file is recognized by image_get_info() as an image. |
| file_validate_name_length | drupal-cvs/includes/file.inc | Check for files with names longer than we can store in the database. |
| file_validate_size | drupal-cvs/includes/file.inc | Check that the file's size is below certain limits. |