Hi,
I wrote some code you can put at the beginning of
your index.php to solve the problem of the upload manager not creating new folders with the needed rights:
I wrote some code you can put at the beginning of
your index.php to solve the problem of the upload manager not creating new folders with the needed rights:
<?php error_reporting(E_ALL); session_start(); $_SESSION['user'] = "Bernd"; // example data $_SESSION['id'] = "5"; $_SESSION['userdir'] = $_SESSION['user'].$_SESSION['id']; // individual folder name $dir = "/html/koeln/UserFiles/".$_SESSION['userdir']; if (is_dir("UserFiles/".$_SESSION['userdir']) != TRUE) // if folder doesnt exist { // create a folder with ftp include ("config/ftp_config.php"); $conn_id = ftp_connect("$ftp_server"); // get ftp-Connection $login_result = ftp_login($conn_id, "$ftp_user_name", "$ftp_user_pass"); $ftp_error = ""; // Var for error-messages if ((!$conn_id) || (!$login_result)) // check connection { $ftp_error = 'not conected!'; } else { $erg = ftp_mkdir($conn_id, $dir); if ($erg != $dir) { $ftp_error = "directory ".$dir." could not be created."; } else { if (!ftp_site($conn_id, 'CHMOD 0777 '.$dir)) { $ftp_error = 'Was not able to change directory rights.'; } } $dir = "/html/koeln/UserFiles/".$_SESSION['userdir']."/Image"; // Ordner für Bilder $erg = ftp_mkdir($conn_id, $dir); if ($erg != $dir) { $ftp_error = "Ordner ".$dir." konnte nicht angelegt werden."; } else { if (!ftp_site($conn_id, 'CHMOD 0777 '.$dir)) { $ftp_error = 'Konnte Ordnerrechte nicht setzen.'; } } $dir = "/html/koeln/UserFiles/".$_SESSION['userdir']."/File"; // Ordner für html-Datei $erg = ftp_mkdir($conn_id, $dir); if ($erg != $dir) { $ftp_error = "Ordner ".$dir." konnte nicht angelegt werden."; } else { if (!ftp_site($conn_id, 'CHMOD 0777 '.$dir)) { $ftp_error = 'Konnte Ordnerrechte nicht setzen.'; } } } ftp_quit($conn_id); // close FTP-stream if ($ftp_error != "") // if there is an error message { include ("error.php"); // show error-file } } include("FCKeditor/fckeditor.php") ; ?>