|
|
|
|
|
create_path(dest=0)
Make sure the destination is a complete path and resides in the file system
directory, if it is not prepend the file system directory. |
source code
|
|
|
|
check_directory(directory,
mode=0,
form_item=None)
Check that the directory exists and is writable + Directories need to
have execute permissions to be considered a directory by FTP servers, etc. |
source code
|
|
|
|
|
|
|
check_location(source,
directory='')
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. |
source code
|
|
|
|
copy(source,
dest=0,
replace=0)
Copies a file to a new location. |
source code
|
|
|
|
destination(destination,
replace)
Determines the destination path for a file depending on how replacement of
existing files should be handled. |
source code
|
|
|
|
move(source,
dest=0,
replace=0)
Moves a file to a new location. |
source code
|
|
|
|
munge_filename(filename,
extensions,
alerts=True)
Munge the filename as needed for security purposes + For instance the file
name "exploit.php.pps" would become "exploit.php_.pps". |
source code
|
|
|
|
|
|
|
create_filename(basename,
directory)
Create a full file path from a directory and filename + If a file with the
specified name already exists, an alternative will be used. |
source code
|
|
|
|
|
|
|
space_used(uid=None)
Determine total disk space used by a single user or the whole filesystem. |
source code
|
|
|
|
save_upload(source,
validators={},
dest=False,
replace=0)
Saves a file upload to a new location + The source file is validated as a
proper upload and handled as such. |
source code
|
|
|
|
|
|
|
validate_extensions(file,
extensions)
Check that the filename ends with an allowed extension + This check is not
enforced for the user #1. |
source code
|
|
|
|
validate_size(file,
file_limit=0,
user_limit=0)
Check that the file's size is below certain limits + This check is not
enforced for the user #1. |
source code
|
|
|
|
|
|
|
validate_image_resolution(file,
maximum_dimensions=0,
minimum_dimensions=0)
If the file is an image verify that its dimensions are within the specified
maximum and minimum dimensions + Non-image files will be ignored. |
source code
|
|
|
|
|
|
|
|
|
|
transfer(source,
headers)
Transfer file using http to client + Pipes a file through Drupal to the
client. |
source code
|
|
|
|
download()
Call plugins that implement hook_file_download() to find out if a file is
accessible and what headers it should be transferred with + If a plugin
returns -1 drupal_access_denied() will be returned + If one or more plugins
returned headers the download will start with the returned headers + If no
plugins respond drupal_not_found() will be returned. |
source code
|
|
|
|
scan_directory(dir,
mask,
nomask=['.', '..', 'CVS'],
callback=0,
recurse=True,
key='filename',
min_depth=0,
depth=0)
Finds all files that match a given mask in a given directory. |
source code
|
|
|
|
|
|
|
|
|
|
|