Drupal mkdir folder permission When creating directory using function drupal_mkdir in custom module, how to set folder permission access to "Create and delete files"?

drupal_mkdir('public://myfolder/');
The second parameter is $mode, which you can provide. e.g.

drupal_mkdir('public://myfolder/', 0755);


By default the 'file_chmod_directory; will be used, which, by default, is 0775.

Exactly what mode you use will obviously depend on your server set up. If you're not sure, ask your sysadmin what it should be.