1. 8.5.x core/includes/file.inc file
  2. 8.0.x core/includes/file.inc file
  3. 8.1.x core/includes/file.inc file
  4. 8.2.x core/includes/file.inc file
  5. 8.3.x core/includes/file.inc file
  6. 8.4.x core/includes/file.inc file
  7. 8.6.x core/includes/file.inc file
  8. 4.6.x includes/file.inc file
  9. 4.7.x includes/file.inc file
  10. 5.x includes/file.inc file
  11. 6.x includes/file.inc file
  12. 7.x includes/file.inc file

Common file handling functions.

File

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

Functions

Namesort descending Location Description
file_check_directory includes/file.inc Check that directory exists and is writable.
file_check_location includes/file.inc Check if a file is really located inside $directory. Should be used to make sure a file specified is really located within the directory to prevent exploits.
file_check_path includes/file.inc Checks path to see if it is a directory, or a dir/file.
file_check_upload includes/file.inc Check if $source is a valid file upload.
file_copy includes/file.inc Copies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy().
file_create_filename includes/file.inc
file_create_path 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 includes/file.inc Create the download path to a file.
file_delete includes/file.inc
file_download includes/file.inc Call modules to find out if a file is accessible for a given user.
file_move includes/file.inc Moves a file to a new location.
file_save_data includes/file.inc Save a string to the specified destination
file_save_upload includes/file.inc Saves a file upload to a new location. The source file is validated as a proper upload and handled as such.
file_scan_directory includes/file.inc Finds all files that match a given mask in a given directory.
file_transfer includes/file.inc Transfer file using http to client. Pipes a file through Drupal to the client.

Constants