getenv() which gives the total path of the site from where it is comming.
$directory= getenv("DOCUMENT_ROOT").base_path() . 'sites/<name_of_folder>';
drupal_mkdir($directory);
// if u want to copy a file to desired path then here is the code.
$desired_filepath = getenv("DOCUMENT_ROOT").base_path() . <path>;
$new_filepath = file_unmanaged_copy($desired_filepath, $directory, FILE_EXISTS_ERROR);
please reach me if u find any problem.
Thanks,
Bhanu Prakash
$directory= getenv("DOCUMENT_ROOT").base_path() . 'sites/<name_of_folder>';
drupal_mkdir($directory);
// if u want to copy a file to desired path then here is the code.
$desired_filepath = getenv("DOCUMENT_ROOT").base_path() . <path>;
$new_filepath = file_unmanaged_copy($desired_filepath, $directory, FILE_EXISTS_ERROR);
please reach me if u find any problem.
Thanks,
Bhanu Prakash
Comments
Post a Comment