File interface

Common file handling functions.

Functions

NameLocationDescription
file_check_directoryincludes/file.incCheck that directory exists and is writable.
file_check_locationincludes/file.incCheck 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_pathincludes/file.incChecks path to see if it is a directory, or a dir/file.
file_check_uploadincludes/file.incCheck if $source is a valid file upload.
file_copyincludes/file.incCopies a file to a new location. This is a powerful function that in many ways performs like an advanced version of copy().
file_create_pathincludes/file.incMake 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_urlincludes/file.incCreate the download path to a file.
file_downloadincludes/file.incCall modules to find out if a file is accessible for a given user.
file_moveincludes/file.incMoves a file to a new location.
file_save_dataincludes/file.incSave a string to the specified destination
file_save_uploadincludes/file.incSaves a file upload to a new location. The source file is validated as a proper upload and handled as such.
file_scan_directoryincludes/file.incFinds all files that match a given mask in a given directory.
file_transferincludes/file.incTransfer file using http to client. Pipes a file through Drupal to the client.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.