mkdir

mkdir ignore mode, but use recursive parameter

PHP's mkdir function has the following signature: bool mkdir ( string $pathname [, int $mode = 0777 [, bool $recursive = false [, resource $context ]]] ) I would like to call this function specifying the $pathname and $recursive set to true, but I wouldn't like to specify the $mode parameter. We control permissions on new files/directo...

php: create directory on form submit?

hey guys, wondering what i'm doing wrong. first time i'm using this function. i'm inside of PATH and i want to create a folder inside of PATH. i wann check if the folder already exists, if not create one. getting the name of the folder from an inputfield with name of "dirname". if (isset($_POST['createDir'])) { //get value of inputf...

PHP and AJAX - mkdir issue

I am working on an intranet application that uses PHP and jQuery. When a user submits a form, the form is passed to another script via AJAX. On one such form the user supplies a Windows UNC path to a server on the network. The handler script needs to create the directory the user specifies so that files can be moved via another process....

Why mkdir fails to work with tilde (~)?

When I write mkdir("~/folder1" , 0777); in linux, it failed to create a directory. If I replace the ~ with the expanded home directory, it works fine. What is the problem with using ~ ? Thanks ...

How do I get CodeIgniter to create new folders?

I have a user system where, when you register for an account, it's supposed to automatically create a new folder for you. I've placed something along the lines of mkdir('./upload/' . $this->session->userdata('id'), 0, true) in my Register controller but to no avail. Does anybody know how to get it to work? ...

INSERT new row and MKDIR with the name of that inserted row ID

The page has to INSERT a row and MAKE a directory with the name of the ID of that row when the user clicks the upload button, will this script work?, what could possibly go wrong?. (when the upload button has been clicked) //insert the new row $query="INSERT INTO photoalbum (userid) VALUES ($userid)"; mysql_query($query); ...

PHP - make a bunch of directories 0-z and sub directories 0-z from an array.

$path-/home/acname/public_html/storage $array= (0,1,2,3,4,5,6,7,8,9,a,b, etc.. z);?? using mkdir(); ??? I want to make directories named 0-9 and a-z each with subdirectories in each one 0-z; eg: /home/acname/public_html/storage/0/0 all the way to /home/acname/public_html/storage/9/z and /home/acname/public_html/storage/a/0 all ...

php mkdir() chmod and permissions

i was using this basic script: $folderPath = "../path/to/$folder/"; mkdir("$folderPath"); i create this directory and then upload photos to it. I've been doing this for a good 4-5 months now and suddenly i start getting 'FORBIDDEN' errors when I attempt to view the contents of the folder via web browser The directory is being created...

php creates folder with 341 permissions

Hey Folks, Didn't got any luck finding an answer on google , so this is my last try before trying other methods. I have a script like this: // get current year and month $cur_year = date('Y'); $cur_month = date('m'); $long_type = $this->getFile_longtype(); $folder = $_SERVER['DOCUMENT_ROOT']."/...

Creating a folder with the current time as name

Hi, I'm trying to write a simple backup script in Ruby that copies a folder to a specific directory with a timestamp in its name. My code is (simplified): require 'Fileutils.rb' time = Time.now FileUtils.cp_r "C:/somefolder", "D:/somefolder_backup_#{time}" But I keep getting `fu_mkdir': Unknown error - mkdir failed (SystemCallError...

Why can't PHP create a directory with 777 permissions?

I'm trying to create a directory on my server using PHP with the command: mkdir("test", 0777); But it doesn't give full permissions, only these: rwxr-xr-x ...

PHP mkdir() and fopen() does not work - permissions problem? umask problem?

The following PHP script fails to create the directory. It will also fail to create the file (when the directory already exists). ini_set('error_reporting', E_ALL); define('ABSPATH', $_SERVER['DOCUMENT_ROOT']); echo ABSPATH . '<br /><br />'; $dir_to_make = ABSPATH . '/aaatest'; $file_to_make = ABSPATH . '/aaatest/aaatest.txt'; echo u...

mkdirs returns false for directory on sd card while the parent directory is writable

At some points while running my android application, I need to create a directory on the sd card, for a small number of users this fails and I can't figure out the reason for it... (I've found similar problems caused by the WRITE_EXTERNAL_STORAGE permission missing, it's there and it works for almost all users so I don't think this is r...