Главная » Drupal » Документация Drupal » Справочник API » Файловый интерфейс
Распечатать статью

Файловый интерфейс

Константы

Имя Описание
FILE_STATUS_TEMPORARY
includes/file.inc
Информация обо всех загруженных в Drupal файлах храниться в таблице {files}. Одним из атрибутов каждого файла является статус — он определяет, является ли файл постоянным или временным. Если файл временный, то встроенная система сбора мусора Drupal удалит его через определённый промежуток времени.

Функции

Имя Описание
file_check_directory
includes/file.inc
Check that the directory exists and is writable. Directories need to have execute permissions to be considered a directory by FTP servers, etc.
file_check_location
includes/file.inc
Проверяет действительно ли файл существует внутри папки $directory. Следует применять для проверки реального существавания файла во избежание уязвимостей
file_check_path
includes/file.inc
Проверяет путь к директории или файлу.
file_copy
includes/file.inc
Копирует файл из одного места в другое. Эта мощная функция работает как расширенная версия функции copy(). Непосредственно перед копированием проверяет правильность $source и $dest и возможность чтения/записи. Копирование файла происходить только если $source и $dest не равны.
file_create_filename
includes/file.inc
Создает полный путь из директории и имени файла. Если указанное имя файла не свободно — будет использовано альтернативное.
file_create_path
includes/file.inc
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_create_url
includes/file.inc
Формирует путь для скачивания файла.
file_delete
includes/file.inc
Удаляет файл.
file_destination
includes/file.inc
Determines the destination path for a file depending on how replacement of existing files should be handled.
file_directory_path
includes/file.inc
Определяет адрес по умолчанию для папки ‘files’ (папка хранения файлов, загруженных пользователями и т.п.)
file_directory_temp
includes/file.inc
Определеляет папку по умолчанию для хранения временных файлов.
file_download
includes/file.inc
Call modules that implement hook_file_download() to find out if a file is accessible and what headers it should be transferred with. If a module returns -1 drupal_access_denied() will be returned. If one or more modules returned headers the download…
file_get_mimetype
includes/file.inc
Determine an Internet Media Type, or MIME type from a filename.
file_move
includes/file.inc
Перемещает файл в новое место.
file_munge_filename
includes/file.inc
Munge the filename as needed for security purposes. For instance the file name ‘exploit.php.pps’ would become ‘exploit.php_.pps’.
file_save_data
includes/file.inc
Сохраняет строку в заданный новый файл.
file_save_upload
includes/file.inc
Сохраняет загруженный файл в новое место. Исходный файл должен быть загружен и обработан.
file_scan_directory
includes/file.inc
Ищет все файлы которые соответствуют заданной маске в заданной директории. Имена файлов начинающиеся с точки исключаются.
file_set_status
includes/file.inc
Устанавливает состояние файла.
file_space_used
includes/file.inc
Определяет общее дисковое пространство используемое пользователем или всей системой
file_transfer
includes/file.inc
Transfer file using http to client. Pipes a file through Drupal to the client.
file_unmunge_filename
includes/file.inc
Отменяет эффект от upload_munge_filename().
file_upload_max_size
includes/file.inc
Определяет максимальный размер загружаемого файла из настроек PHP.
file_validate_extensions
includes/file.inc
Проверяет соответствует ли окончание файла допустимым расширениям. Пользователь с UID=1 всегда проходит эту проверку.
file_validate_image_resolution
includes/file.inc
If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions. Non-image files will be ignored.
file_validate_is_image
includes/file.inc
Проверяет, распознаётся ли файл функцией image_get_info() как изображение.
file_validate_name_length
includes/file.inc
Check for files with names longer than we can store in the database.
file_validate_size
includes/file.inc
Check that the file’s size is below certain limits. This check is not enforced for the user #1.

Источник: drupal.ru

Вы можете оставить комментарий, или обратную ссылку на Ваш сайт.

Оставить комментарий

Похожие статьи