Monday, September 26, 2011

File Handling in Drupal - file_save_upload()

Syntax:
file_save_upload($source,
$validators
= array(), $dest = FALSE, $replace = FILE_EXISTS_RENAME)

Example:
$thumbnailPath = file_directory_path() . "/thumbnail"
$chapter_uploaded_file = file_save_upload($video, array(), $thumbnailPath);
file_set_status($chapter_uploaded_file, FILE_STATUS_PERMANENT);

No comments:

Post a Comment

Followers