php - How to create a folder in site->default->files with write read permissions with Drupal? -
im working on ubuntu , need create folder in drupal's default->files folder write permission able add files folder later on.
here code i'm having,
please help.
drupal_mkdir('public://' . $new_dir . '/'); $file = file_copy($file, 'public://' . $new_dir . '/' . $file_name);
drupal_mkdir('public://' . $new_dir , 0777);
if need recursive set third argument true.
update:
$oldumask = umask(0); drupal_mkdir("public://". $new_dir , 0777); umask($oldumask);
Comments
Post a Comment