File Upload/Download Manager

Functions for modules to use the managed file repository. Modules using this repository don't have to deal with filenames, directory, size limits, or creating download URLs.

File Manager supports both private(access controlled) and public files. When a module adds a file to the file manager they specify which type of file it is. A module may use both public and private files at the same time, but an individual may only be public or private.

Functions

Namesort iconLocationDescription
filemanager_add_filefilemanager/filemanager.moduleAdds a file into the repository as a working copy
filemanager_add_uploadfilemanager/filemanager.moduleSaves a file uploaded into a the file store as a working copy.
filemanager_area_listfilemanager/filemanager.moduleReturns a list of file areas used by the current module set
filemanager_create_directory_pathfilemanager/filemanager.moduleReturns the path to a the directory where this file is located.
filemanager_create_pathfilemanager/filemanager.moduleReturns the path to a file in the filestore
filemanager_deletefilemanager/filemanager.moduleRemoves a file from a repository
filemanager_get_area_infofilemanager/filemanager.moduleReturns statistics object about a given filestore area. The object contains the following fields: size - the total size of all files in the area filecount - which is the number of files in the area. sizelimit - the size limit for this area
filemanager_get_file_infofilemanager/filemanager.moduleReturns a filestore object containing information about a given file. Passing in a filestore object will just pass the same object back out.
filemanager_get_sizefilemanager/filemanager.moduleReturns the total size in bytes of all current active files.
filemanager_get_working_copyfilemanager/filemanager.moduleGets a working copy of the active version of a file in the filestore
filemanager_get_working_sizefilemanager/filemanager.moduleReturns the total size in bytes of all the current working files. We have to use the filesystem since sizes of working files will not be accurate in the database.
filemanager_lfilemanager/filemanager.moduleCreate a link to download a file in the filestore.
filemanager_promote_workingfilemanager/filemanager.modulePromotes a working copy of a file to the active copy
filemanager_purge_orphansfilemanager/filemanager.modulePurges out files over the age limit in the working repository for all areas
filemanager_purge_workingfilemanager/filemanager.modulePurge a working file from the repository
filemanager_renamefilemanager/filemanager.moduleRenames an existing file in the filestore
filemanager_set_privatefilemanager/filemanager.moduleMoves the file from public to private or vice versa
filemanager_transferfilemanager/filemanager.moduleTransfers a file to the client after calling modules to find out if a file is accessible for a given user. This function is here to support legacy private downloads
filemanager_urlfilemanager/filemanager.moduleCreate the URL to download a file in the filestore.
_filemanager_update_filefilemanager/filemanager.modulehelper function for filemanager_rename and filemanager_set_private does the actual file moving from $oldactive and $oldworking to the values set in the $file object