Hallo ein Dateiupload funktioniert in meiner localhost/xampp Umgebung einwandfrei, auf dem Rootserver aber nicht.
Folgende Ausgaben:
=> Array ( [name] => Testdatei.txt [type] => text/plain [tmp_name] => /tmp/phprdorxb [error] => 0 [size] => 32 ) )
Upload-Datei: /tmp/phprdorxb
Fehlercode beim Upload: 0
Fehler:There is no error, the file uploaded with success
Es gibt zwar einen Fehlercode 0, die Datei wird aber nicht in das Verzeichnis geladen.
Zusatzinfo: in der php.ini sind uploads zugelassen, ich habe aber folgenden Eintrag gemacht:
upload_tmp_dir = /home/dokumente_
	
							
						
					Folgende Ausgaben:
=> Array ( [name] => Testdatei.txt [type] => text/plain [tmp_name] => /tmp/phprdorxb [error] => 0 [size] => 32 ) )
Upload-Datei: /tmp/phprdorxb
Fehlercode beim Upload: 0
Fehler:There is no error, the file uploaded with success
Es gibt zwar einen Fehlercode 0, die Datei wird aber nicht in das Verzeichnis geladen.
Zusatzinfo: in der php.ini sind uploads zugelassen, ich habe aber folgenden Eintrag gemacht:
upload_tmp_dir = /home/dokumente_
PHP-Code:
	
	
$dateiname = $_SESSION['dateiname'] = trim($_FILES['datei']['name']);
$path = $_SESSION['directory'] . $unternehmen . "_MUSTERDOKUMENTE";
if (!file_exists($path)) {
    mkdir($path, 0755);
}
$pathfilename = $path . "/" . $dateiname;
if (!move_uploaded_file($_FILES['datei']['tmp_name'], $pathfilename)) {
    print_r($_FILES);
    echo "<br>Upload-Datei: " . $_FILES['datei']['tmp_name'];
    echo "<br>Fehlercode beim Upload: " . $_FILES['datei']['error'];
    $fehlercode = array (
        0 => "There is no error, the file uploaded with success",
        1 => "The uploaded file exceeds the upload_max_filesize directive in php.ini",
        2 => "The uploaded file exceeds the MAX_FILE_SIZE directive that was 
specified in the HTML form",
        3 => "The uploaded file was only partially uploaded",
        4 => "No file was uploaded",
        6 => "Missing a temporary folder"
    );
    $index = $_FILES['datei']['error'];
    echo "<br>Fehler:" . $fehlercode[$index];
} else {
    $typ = "m";
    $musterdokname = $musterdokument->speichernMusterdok($typ);
    $musterdokument->anzeigeMusterdok($musterdokname, $typ);
} 
 
          
 Moderator
 Moderator
Kommentar