Hallo. Ich habe folgendes Problem, und zwar kann ich keine .zip, .rar, .xls Dateien hochladen, obwohl ich den Typ angeben habe. Die angeblichen Schlüsselwörter habe ich alle von selfhtml.de. Hoffe jemand kann mir helfen bzw. nen Tip geben.
*thx*
*thx*
PHP:
<?PHP
if (isset($_POST['button'])) {
$tempname = $_FILES['file']['tmp_name'];
$name = $_FILES['file']['name'];
$type = $_FILES['file']['type'];
$size = $_FILES['file']['size'];
$datei=$_POST['datei'];
$art= $_SESSION['art'];
$link = $name;
$sql = "INSERT INTO dwnlds(Datei,Art,Link) VALUES('".$datei."','".$Art."','".$link."' );";
mysql_query($sql);
mysql_close();
if($type != "image/gif" && $type != "image/jpeg" && $type != "text/plain" && $type != "application/x-zip-compressed" && $type != "application/x-rar-compressed" && $type != "application/msexcel" && $type != "application/mspowerpoint" && $type != "application/msword" && $type != "application/octet-stream" && $type != "application/pdf" && $type != "application/rtf" && $type != "application/xhtml+xml" && $type != "application/xml" && $type != "application/x-shockwave-flash" && $type != "image/tiff" && $type != "application/zip" && $type != "application/x-compressed" && $type != "application/x-zip-compressed" && $type != "multipart/x-zip" && $type != "application/x-zip") {
$err[] = "Die Datei besitzt eine nicht konforme Dateiendung.<br>Archivieren Sie die Datei mit WinZip bzw. WinRar. ";
}
if($size > "10000000") {
$err[] = "Die Datei welche du hochladen willst, ist zu gross!<br>Maximale Dateigrosse beträgt 15 KB!";
}
if(empty($err)) {
copy("$tempname", "../../usrmgt/downloads/$name");
echo "Die Datei $name wurde erfolgreich hochgeladen!<br>";
}
else {
foreach($err as $error)
echo "$error<br>";
}
?>