codeigniter creating a directory
How do I create a directory using codeigniter? Basically what I am trying to do is allow user to upload files and then c开发者_运维技巧reate a directory on the fly for storing these file could anyone point me on how could I create a directory using codeigniter
Thanks All efforts will be appreciated
I have run the following codes in windows which works perfect for me-
<?php
$path = "uploads/product";
if(!is_dir($path)) //create the folder if it's not already exists
{
mkdir($path,0755,TRUE);
}
?>
Here 0755 is permission of the folder to be created. 755 means you can do anything with the file or directory, and other users can read and execute it but not alter it. Suitable for programs and directories you want to make publicly available.
Use mkdir
mkdir("/path/to/my/dir");
精彩评论