Hi,
Undzwar hab ich ein kleines Upload Script. Wenn man dort aber die upload.php im Browser aufruft, erstellt es einen Ordner. Der Ordner sollte aber nur erstellt werden wenn etwas hochgeladen wird
Hier mal das Script

:
PHP-Code:
<?php
#include config
require 'config.php';
#informationen holen
$name=$_FILES['file']['name'];
#hier direkt die umlautumwandlung eingeschoben
$name=preg_replace( array("/ä/","/ö/","/ü/","/Ä/","/Ö/","/Ü/","/ /"),array("ae","oe","ue","Ae","Oe","Ue","_"), $name);
#crypt
$cryptstring = date('h-i-s, j-m-y, it is w Day z ');
$crypted = crypt("$cryptstring");
$pool = "qwertzupasdfghkyxcvbnm";
$pool .= "23456789";
$pool .= "WERTZUPLKJHGFDSAYXCVBNM";
srand ((double)microtime()*1000000);
for($index = 0; $index < 24; $index++)
{
$zufall .= substr($pool,(rand()%(strlen ($pool))), 1);
}
$pool2 = "qwertzupasdfghkyxcvbnm";
$pool2 .= "23456789";
$pool2 .= "WERTZUPLKJHGFDSAYXCVBNM";
srand ((double)microtime()*1000000);
for($index = 0; $index < 32; $index++)
{
$zufall2 .= substr($pool2,(rand()%(strlen ($pool2))), 1);
}
$pool3 = "qwertzupasdfghkyxcvbnm";
$pool3 .= "23456789";
$pool3 .= "WERTZUPLKJHGFDSAYXCVBNM";
srand ((double)microtime()*1000000);
for($index = 0; $index < 16; $index++)
{
$killcode .= substr($pool3,(rand()%(strlen ($pool3))), 1);
}
$ordner = mkdir ("/var/www/image/test/upload/$zufall", 0700);
#rest der infos
$size=$_FILES['file']['size'];
$tmpname=$_FILES['file']['tmp_name'];
$filepath = "upload/$zufall/$name";
$realpath=realpath("./");
$uploadziel = "$realpath/$filepath";
#mime-check
$splited = explode(".", $name);
$abfrage = "SELECT * FROM mime WHERE endung ='$splited[1]' LIMIT 1";
$ergebnis = mysql_query($abfrage);
$row = mysql_fetch_object($ergebnis);
if($row == FALSE){
die("File Type not allowed!");
}else{
$mime = $row->mime_type;
}
#upload und ausgabe dl link
$inhalt="<tr><td>
Upload erfolgreich.<br>
Dein Downloadlink ist <a href=\"$url/getfile.php?id=$zufall2\" color=\"red\"> $url/getfile.php?id=$zufall2 </a><br>
Dein Loeschlink ist <a href=\"$url/del.php?id=$zufall2&killcode=$killcode\" color=\"red\"> $url/del.php?id=$zufall2&killcode=$killcode </a><br></td></tr>";
if(move_uploaded_file($tmpname, $uploadziel))
{
$insert = "INSERT INTO dl ( c_id, filepath, filename, mime_type, killfile) VALUES ('".$zufall2."', '".$filepath."', '".$name."', '".$mime."', '".$killcode."')";
mysql_query($insert);
include("template.php");
}
else{
echo "Upload fehlgeschlagen.";
}
?>