Upload fil virker ikke?
Udklip. Hvorfor virker det ikke. Scriptet kan godt registrere hvis filen allerede findes, men kan ikke uploade.Destinationsbibliotek er chmod til 777:
$sizelimit = "no"; //Do you want a size limit, yes or no?
$sizebytes = "200000"; //size limit in bytes
$dl = "http://www.xxx.dk"; //url where files are uploaded
$absolute_path = "images/xxx"; //Absolute path to where files are uploaded
$websiteurl = "http://www.xxx.dk"; //Url to you website
$websitename = " xxx";
switch($action) {
default:
echo"
<body>
</body>
</html>";
break;
case "upload":
echo"
<html>
<head>
<title>Uploade filer</title>
</head>
<body>
<form method=POST action=?list=upload.php&action=doupload enctype=multipart/form-data>
<p>Vælg fil, som skal uploades:<br>
VIGTIGT!!:BEMÆRK at filen skal hedde det, som tidligere er henvist!!!!<br>
<input type=file name=file size=30>
<p><button name=submit type=submit>
Upload
</button>
</form>
</body>
</html>";
break;
//File Upload
case "doupload":
$dir = "dir";
if ($file != "") {
if (file_exists("$absolute_path/$file_name")) {
die("Filen eksisterer allerede.<br><br>");
}
if (($sizelimit == "yes") && ($file_size > $sizebytes)) {
die("Filen er for stor. Maximal størrelse er $sizebytes bytes.<br><br>");
}
@copy($file, "$absolute_path/$file_name") or die("Filen, som du forsøger at uploade er IKKE uploadet.<br><br>");
}
else {
die("Der er sket en fejl, og billedet er <i>ikke</i> uploadet.");
}
echo "
<html>
<body>";
echo $file_name. " er uploaded..<br><br>";
echo "<br>
</body>
</html>";
break;
}}
?>
