I am trying to create a photo gallery. the first step in uploading a set of images will be to create a directory for the gallery based on the current time. The problem that i seem to be having is chmoding the directory correctly. This is my current code:
if($create){
$day=mktime();
$the_path=$photoRoot."".$day."/";
if(mkdir ($the_path,0777)){
session_register("the_path");
echo uploadForm();
exit;
} else {
echo "Failed to create New Directory!<br>";
}
}[/COLOR]
My Upload Code:
$upload=$the_path."".$the_file_name;
if(copy($the_file,$upload)){ (line 13)
echo "Coppied File!<br>";
} else {
echo $the_file_name."<br>";
echo $upload."<br>";
echo "Could not copy file!<br>";
}
The error:
Warning: copy(/home/asachito/public_html/photos/1099956125/logo.jpg): failed to open stream: Permission denied in /home/asachito/public_html/admin/images/index.php on line 13
I have used both $_SERVER['DOCUMENT_ROOT'] and "../../photos/[day]/ as copy to paths.
Thanks in advance for any help!