Version

1.145 (checked in on 2008/11/16 at 19:41:14 by dries)

Description

API for handling file uploads and server file management.

Constants

Namesort iconDescription
FILE_CREATE_DIRECTORYFlag used by file_check_directory() -- create directory if not present.
FILE_DOWNLOADS_PRIVATEFlag to indicate that the 'private' file download method is enabled.
FILE_DOWNLOADS_PUBLICFlag to indicate that the 'public' file download method is enabled.
FILE_EXISTS_ERRORFlag for dealing with existing files: Do nothing and return FALSE.
FILE_EXISTS_RENAMEFlag for dealing with existing files: Appends number until name is unique.
FILE_EXISTS_REPLACEFlag for dealing with existing files: Replace the existing file.
FILE_MODIFY_PERMISSIONSFlag used by file_check_directory() -- file permissions may be changed.
FILE_STATUS_PERMANENTFile status -- File has been permanently saved to the {files} tables.
FILE_STATUS_TEMPORARYFile status -- File has been temporarily saved to the {files} tables.

Functions

Namesort iconDescription
file_check_directoryCheck that the directory exists and is writable.
file_check_locationCheck if a file is really located inside $directory.
file_check_pathChecks path to see if it is a directory, or a directory/file.
file_copyCopy a file to a new location and adds a file record to the database.
file_create_filenameCreate a full file path from a directory and filename.
file_create_pathMake 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_urlCreate the download path to a file.
file_deleteDelete a file and its database record.
file_destinationDetermines the destination path for a file depending on how replacement of existing files should be handled.
file_directory_pathDetermine the default 'files' directory.
file_directory_tempDetermine the default temporary directory.
file_downloadMenu handler for private file transfers.
file_get_mimetypeDetermine an Internet Media Type, or MIME type from a filename.
file_loadLoad a file object from the database.
file_moveMove a file to a new location and update the file's database entry.
file_munge_filenameMunge the filename as needed for security purposes.
file_saveSave a file object to the database.
file_save_dataSave a string to the specified destination and create a database file entry.
file_save_uploadSaves a file upload to a new location.
file_scan_directoryFinds all files that match a given mask in a given directory.
file_space_usedDetermine total disk space used by a single user or the whole filesystem.
file_transferTransfer file using HTTP to client. Pipes a file through Drupal to the client.
file_unmanaged_copyCopy a file to a new location without calling any hooks or making any changes to the database.
file_unmanaged_deleteDelete a file without calling any hooks or making any changes to the database.
file_unmanaged_moveMove a file to a new location without calling any hooks or making any changes to the database.
file_unmanaged_save_dataSave a string to the specified destination without calling any hooks or making any changes to the database.
file_unmunge_filenameUndo the effect of upload_munge_filename().
file_upload_max_sizeDetermine the maximum file upload size by querying the PHP settings.
file_validateCheck that a file meets the criteria specified by the validators.
file_validate_extensionsCheck that the filename ends with an allowed extension.
file_validate_image_resolutionIf the file is an image verify that its dimensions are within the specified maximum and minimum dimensions.
file_validate_is_imageCheck that the file is recognized by image_get_info() as an image.
file_validate_name_lengthCheck for files with names longer than we can store in the database.
file_validate_sizeCheck that the file's size is below certain limits.