O.K. hier das script...
<?PHP
// special chars to be replaced
$signs = array("ä"," ","ö","ü","&","?","ß","+","~","/");
$bad_ext = array(".hta",".htp",".php",".pl",".cgi");
$root = "/server/path/to/home/";
// copy to this directory
if (!isset($dir)){
$dir = "c:\apache/htdocs/upload/dateien/";
$shortdir = "http://localhost/upload/dateien/";
}
?>
<html>
<head>
<title>Upload Directory</title>
<style>
body,td,input {font-family:verdana,arial;font-size:13px;}
th {text-align:left;font-size:13px}
</style>
</head>
<body>
<b>S-Upload-Tool der Sparkasse Neuss</b>
<hr size="1" noshade width="100%">
<br>
<?PHP
// events to be proceeded
// copy the file to the server
if (isset($submit)){
$userfile_name = str_replace($signs,"_",$userfile_name);
$userfile_name = str_replace($bad_ext,".txt",$userfile_name);
copy($userfile,$dir.$userfile_name);
if (!is_uploaded_file ($userfile)){
echo "<font color=red>Die Datei <b>$userfile_name</b> konnte nicht auf den Server geladen werden.</font>\n";
}
}
// check whether file has been uploaded
if (is_uploaded_file ($userfile)){
print "<font color=green>Die Datei <b>$userfile_name</b> wurde erfolgreich auf den Server geladen.</font>\n";
}
// change directory for listing
if (isset ($changedir)){
while(list($key, $val) = each($selection)) {
if(filetype($dir.$val) == "dir") {
$dir = $dir.$val."/";
$shortdir = $shortdir.$val."/";
}
else {
echo "<font color=red>Die Datei <b>$val</b> ist kein Ordner.</font>\n";
}
}
}
// change directory to next higher level for listing
if (isset ($cdup)){
$array = explode("/",$dir);
$array2 = explode("/",$shortdir);
$parts = count($array);
$parts2 = count($array2);
$updir = "";
$updir2 = "";
for($x=0;$x<($parts - "2");$x++) {
$updir = $updir.$array[$x]."/";
}
for($x=0;$x<($parts2 - "2");$x++) {
$updir2 = $updir2.$array2[$x]."/";
}
$z = substr_count($updir, $root);
if ( $z < "1"){
echo "<font color=red>Diese Aktion ist nicht erlaubt!</font>\n";
}
else {
$dir = $updir;
$shortdir = $updir2;
}
}
// delete file and dir
if (isset ($delete)){
while(list($key, $val) = each($selection)) {
if (filetype($dir.$val) == "dir"){
rmdir($dir.$val);
print "<font color=green>Der Ordner <b>$shortdir$val</b> wurde erfolgreich vom Server gelöscht.</font>\n";
}
else {
unlink($dir.$val);
print "<font color=green>Die Datei <b>$shortdir$val</b> wurde erfolgreich vom Server gelöscht.</font>\n";
}
}
}
// create new directory
if (isset ($createdir)){
$newdir = str_replace($signs,"_",$newdir);
mkdir($dir.$newdir,0755);
echo "<font color=green>Der Ordner <b>$newdir</b> wurde erstellt.</font>\n";
}
?>
<br>
<form name="uploadfile" enctype="multipart/form-data" action="<?PHP echo $PHP_SELF ?>" method="post">
<table border="0"><tr>
<td><b>Datei:</b> </td>
<td><input name="userfile" type="file" size="20">
<input type="hidden" name="dir" value="<?PHP echo $dir ?>">
<input type="hidden" name="shortdir" value="<?PHP echo $shortdir ?>">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"></td>
<td><input type="submit" value="upload" name="submit"></td></tr>
</form>
<form name="createdir" enctype="multipart/form-data" action="<?PHP echo $PHP_SELF ?>" method="post">
<tr><td><b>Verzeichnis:</b> </td>
<td><input name="newdir" type="text" size="35">
<input type="hidden" name="shortdir" value="<?PHP echo $shortdir ?>">
<input type="hidden" name="dir" value="<?PHP echo $dir ?>"></td>
<td><input type="submit" value="create" name="createdir"></td></tr></table>
Bitte <b>nur einmal</b> klicken und auf die Bestätigung warten
</form>
<a href="<?PHP echo $PHP_SELF ?>"><font color=blue>Startverzeichnis</font></a><br><br><br>
<hr size="1" noshade width="100%">
<b>Verzeichnisübersicht</b> <?PHP print "$shortdir"; ?>
<hr size="1" noshade width="100%">
<form name="display" enctype="multipart/form-data" action="<?PHP echo $PHP_SELF ?>" method="POST">
<input type="hidden" name="dir" value="<?PHP echo $dir ?>">
<input type="hidden" name="shortdir" value="<?PHP echo $shortdir ?>">
<?PHP
$size_sum = "0";
echo "\n <table border=0 cellspacing=5>\n";
echo " <tr><td colspan='3'><input type='submit' name='cdup' value='cdup'></td></tr>";
echo " <tr><th colspan='2'></th><th width=120>Dateiname</th><th width=120>Dateigröße</th><th width=120>Upload-Zeit</th><tr>\n";
$verz=opendir ($dir);
$n = 0;
while ($file = readdir ($verz)) {
if($file != "." && $file != ".." && $file != $PHP_SELF && $file != ".htaccess" && $file != ".htpasswd") {
echo " <tr><td><input type=checkbox name=selection[$n] value=$file></td><td>";
if(filetype($dir.$file) == "dir") {
echo "<img src='icons/folder.gif' width='16' height='16' border='0' alt='directory'>";
}
elseif(filetype($dir.$file) == "file") {
echo "<img src='icons/binary.gif' width='16' height='16' border='0' alt='file'>";
}
else {
echo "<img src='icons/unknown.gif' width='16' height='16' border='0' alt='unknown'>";
}
echo "</td><td width=120><a href='$shortdir$file' target='_blank'><font color=brown>$file</font></a></td><td width=120> (".number_format(filesize($dir.$file)/1000,3,",",".")." Kb)</td><td>".gmdate("d M Y - H:i:s", filemtime($dir.$file))."</td></tr>\n";
$size_sum = $size_sum + number_format(filesize($dir.$file),3,",","");
$n ++;
}
}
closedir($verz);
$output = number_format($size_sum/1000,3,",",".");
echo " <tr><th colspan='2'></th><th>Summe:</th><th>".$output." Kb</th></tr>\n";
echo " </table>\n";
?>
<hr size="1" noshade width="100%">
<input type='submit' value='delete' name='delete'>
<input type='submit' value='GoTo' name='changedir'>
</form>
<br><br>
</body>
</html>
hoffe jemand kann mir helfen...
MfG
Znyper