Ich habe Probleme mit meinem (wahrscheinlich total schlechtem)Uploadformular. Es zeigt mir diese Fehlermeldung beim Ausführen:
[COLOR=red]
Warning: Unable to create '/home/www/web71/html/dateien/datei_name': Permission denied in /home/www/web71/html/admin/inhalt/VerbandDownloadarchiv.php on line 120
Warning: Unable to move '/home/www/web71/phptmp/phpajKpma' to '/home/www/web71/html/dateien/datei_name' in /home/www/web71/html/admin/inhalt/VerbandDownloadarchiv.php on line 120
Upload fehlgeschlagen
[/COLOR]
Das ist der Code: Er soll eine Datei hochladen und Informationen dazu in einer Datenbank speichern!
	
Danke im Vorraus für alle Hinweise!!!
							
						
					[COLOR=red]
Warning: Unable to create '/home/www/web71/html/dateien/datei_name': Permission denied in /home/www/web71/html/admin/inhalt/VerbandDownloadarchiv.php on line 120
Warning: Unable to move '/home/www/web71/phptmp/phpajKpma' to '/home/www/web71/html/dateien/datei_name' in /home/www/web71/html/admin/inhalt/VerbandDownloadarchiv.php on line 120
Upload fehlgeschlagen
[/COLOR]
Das ist der Code: Er soll eine Datei hochladen und Informationen dazu in einer Datenbank speichern!
PHP-Code:
	
	
<?php
include("configuration.php");
$style ="border:1px groove #000000;border-style:solid;font-size:8pt;font-family:verdana;color:#000000;background:#FFFFFF";
if(isset($send)) {
  $all_ok = "1";
  if (!(eregi("[a-zA-Z0-9/\@.,();:_-]",$datei))) {
     $all_ok = "0";
  }
  if (!(eregi("[a-zA-Z0-9/\@.,();:_-]",$beschreibung))) {
     $all_ok = "0";
  }
  if (!(eregi("[a-zA-Z0-9/\@.,();:_-]",$kb))) {
     $all_ok = "0";
  }
  if($all_ok == "1"){
    $insert = "INSERT INTO downloadarchiv (nr,datei,beschreibung,kb) values ('$nr', '$datei' ,'$beschreibung', '$kb')";
    mysql_query($insert);
  }
}
$read = "SELECT * FROM downloadarchiv";
$result= mysql_query($read);
$anzahl = mysql_num_rows($result);
$bytes = "?";
$zielverzeichnis = $DOCUMENT_ROOT."/dateien/";
echo"
<center>
<form method=\"POST\" action=\"$php_self\" enctype=\"multipart/form-data\">
    
    <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
    <tr>
       <td>$schrift Datei:</td>
           <td valign=\"top\"> <input type=\"file\" name=\"datei\" STYLE=\"$style\"> </td>
        </tr>
        <tr>
         <td>$schrift Beschreibung:</td>
           <td valign=\"top\"><input STYLE=\"$style\"></td>
        </tr>
        <tr>
       <td></td>
       <td valign=\"top\"> $schrift <input type=\"submit\" value=\"Hinzufügen\" name=\"send\" style=\"$style\"> Anzahl der Daten: <i>$anzahl</i> </td>
        </tr>
        </table>
    <input type=\"hidden\" name=\"nr\" value=\"$nr\">
    <input type=\"hidden\" name=\"kb\" value=\"$datei_size\">
</form>
";
if(isset($send)) {
  if (!file_exists($zielverzeichnis.datei_name)) {
     if (move_uploaded_file($datei, $zielverzeichnis.datei_name)) {
    echo"Datei wurde erfolgreich hochgeladen!";    
    
     } else {
    echo"Upload fehlgeschlagen";
     
     }
  
  } else {
     echo"Datei bereits vorhanden. Bitte Dateinamen ändern";
  }
}
mysql_close();
?>
 
          



Kommentar