Same name and namespace in other branches
Common file handling functions.
File
- includes/
file.inc, line 14 - API for handling file uploads and server file management.
Functions
Name | Location | Description |
---|---|---|
file_create_url |
includes/ |
Create the download path to a file. |
file_create_path |
includes/ |
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_check_directory |
includes/ |
Check that directory exists and is writable. |
file_check_path |
includes/ |
Checks path to see if it is a directory, or a dir/file. |
file_check_upload |
includes/ |
Check if $source is a valid file upload. |
file_check_location |
includes/ |
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_copy |
includes/ |
Copies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy(). |
file_move |
includes/ |
Moves a file to a new location. |
file_create_filename |
includes/ |
|
file_delete |
includes/ |
|
file_save_upload |
includes/ |
Saves a file upload to a new location. The source file is validated as a proper upload and handled as such. |
file_save_data |
includes/ |
Save a string to the specified destination |
file_transfer |
includes/ |
Transfer file using http to client. Pipes a file through Drupal to the client. |
file_download |
includes/ |
Call modules to find out if a file is accessible for a given user. |
file_scan_directory |
includes/ |
Finds all files that match a given mask in a given directory. |
Constants
Name | Location | Description |
---|---|---|
IS_WINDOWS |
includes/ |
|
FILE_DOWNLOADS_PUBLIC |
includes/ |
|
FILE_DOWNLOADS_PRIVATE |
includes/ |
|
FILE_CREATE_DIRECTORY |
includes/ |
|
FILE_MODIFY_PERMISSIONS |
includes/ |
|
FILE_DIRECTORY_TEMP |
includes/ |
|
FILE_EXISTS_RENAME |
includes/ |
|
FILE_EXISTS_REPLACE |
includes/ |
|
FILE_EXISTS_ERROR |
includes/ |