Hallo,
ich versuch über ein Formular eine Datei hoch zu laden. Bei den meisten funktioniert das auch ganz gut. Bei einigen bekomme ich jedoch ein Fenster mit der Meldung ' Das Dokument enthält keine Daten. '
Wär schön, wenn du uns deinen Quelltext zeigen könntest,
sonst müssen wir wohl oder übel raten.
Hatte jemand schon mal ein gleiches Problem??
Ja ich:
<?php
header('Content-Type: application/xhtml+xml');
ob_start('ob_gzhandler');
$ordner=$_POST['ordner'];
$file=$_POST['file'];
if(!empty($ordner)) {
$verboten=array(".","\","/"," ");
for($x=0;$x<3;$x++) {
$ordner=str_replace($verboten[$x],"",$ordner);
}
}
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Upload auf Alexanders Server</title>
<link href="./upload.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
echo "$ordner<br />";
echo $file_name;
if(!empty($file_name)) {
if(!empty($ordner)) {
if(chdir($ordner) != true) {
if(mkdir($ordner,644)) {
if(copy($file,"$ordner/$file_name")) {
echo '<b>Upload beendet!</b><br />
Noch 'ne Datei?';
}
}
if(chdir($ordner) == true) {
if(copy($file,"$file_name")) {
echo '<b>Upload beendet!</b><br />
Noch 'ne Datei?';
}
}
}
}
else {
if(copy($file,"tmp/$file_name")) {
echo '<b>Upload beendet!</b><br />
Noch 'ne Datei?';
}
}
}
?>
<form name="form1" enctype="multipart/form-data" method="post" action="upload.php">
<input type="file" name="file" />
<br />Die Datei, die Du hochladen willst.
<br />
<input type="text" name="ordner" maxlength="20" />
<br />Der Ordner
<br />
<input type="submit" name="Abschicken" value="Upload beginnen" />
</form>
</body>
</html>
Funktioniert nicht die Bohne und ich hab keine Ahnung, warum.
Gruß
Alexander Brock
SelfCode: sh:( fo:) ch:? rl:( br:> n4:? ie:{ mo:} va:) de:> zu:| fl:{ ss:( ls:[ js:(
http://emmanuel.dammerer.at/selfcode.html
Deshalb können Pinguine nicht fliegen:
Was nicht fliegt kann auch nicht abstürzen
<img src="http://www.againsttcpa.com/images/AgainstTCPA-Log01Small.gif" border="0" alt="">
http://againsttcpa.com