Hallo erstmal,
ich hab jetzt zum ersten Mal einen Dateiupload in PHP getestet und dabei natürlich prompt einen Fehler bekommen:
"SAFE MODE Restriction in effect. The script whose uid is 65534 is not allowed to access / owned by uid 0"
das Script sieht so aus:
<h1>Upload</h1>
<form
action="<?php echo $_SERVER['PHP_SELF']; ?>"
method="post"
enctype="multipart/form-data">
<input type="file" name="probe" />
<input type="text" name="autor" value="Autor">
<input type="text" name= "titel" value="Titel">
<input type="submit" value="Los!" />
</form>
<hr />
<?php
include "config.php";
mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASS) OR die(mysql_error());
mysql_select_db(MYSQL_DATABASE) OR die(mysql_error());
$sql = "SELECT
ID
FROM
download
ORDER BY
ID DESC";
$result = mysql_query($sql) OR die(mysql_error());
while($row = mysql_fetch_assoc($result))
{
break;
}
if (isset($_FILES['probe']) and ! $_FILES['probe']['error']) {
if ($_FILES['probe']['type']!="application/x-zip-compressed" && $_FILES['probe']['type']!="application/rar")
{
die("Unerlaubtes Dateiformat!");
}
else {
if ($_FILES['probe']['type']=="application/x-zip-compressed") {
$file = "/uploaded/neu.zip";
move_uploaded_file($_FILES['probe']['tmp_name'], $file);
}
else {
$file = "/uploaded/neu.rar";
move_uploaded_file($_FILES['probe']['tmp_name'], $file);
}
}
}
echo "Autor: ".$_POST['autor'];
?>
Es ist noch nicht fertig, sollte so aber normalerweise funktionieren. Was ist das für ein Error? Wie kann man ihn beheben? Falls das etwas hilft: Ich, bzw. der für den ich das Script schreibe ist bei www.xail.net angemeldet.