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...
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...
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....
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
...
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?
...
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); ...
$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 ...
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...
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']."/...
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...
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
...
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...
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...