hello everyone, I have this script:
switch ($action) {
default:
if (($size_limit == yes) or ($filesize_limit != "")) {
$fsize = $filesize_limit;
$fsize .= " bytes";
}
else {
$fsize = "any size";
}
echo "<form method=\"post\" action=\"index.php?action=upload\" enctype=\"multipart-formdata\">
Select File: <input type=\"file\" name=\"file\" style=\"font-family: tahoma; font-size: 10px; color: #000000; border: 1px solid #000000; background-color: #FFFFFF; padding-left: 2; padding-right: 2;\"><br>
Max File Size: $fsize
<br>
<table><TR><TD><button type=\"submit\">Upload</button></TD><TD width=\"15\"><TD><button type=\"reset\">Reset</button></TR></table>
</form>
";
break;
case "upload":
if ($HTTP_POST_FILES['file']['name'] != "") {
if (($size_limit == yes) or ($filesize_limit != "")) {
if ($HTTP_POST_FILES['file']['size'] > $filesize_limit) {
$log = "The file's size was too big.<br>";
}
}
else {
$filename = $HTTP_POST_FILES['file']['name'];
copy($file, "$uploaddir/$filename") or $log = "Could not upload the file.";
}
}
else {
$log = "Please choose a file to upload.<br>";
}
echo "$log";
break;
}
I don't get any errors with it but everytime I try to upload something, I get the message:"Please choose a file to upload.".
does anyone know why the script does'nt seem to be detecting a filename?
thanx