} $md5 = md5_file($pathPart); $dbConnect->addLuaFile($local, $url, $id, $md5, $userId); die("Uploaded"); break; case 6: //upload image if (!isset($_GET['nid'])) { die("invalid parameter"); } $id = intval($_GET['nid']); if ($dbConnect->checkNameRight($id, $userId)) { $pathPart = "images/" . $id . "_" . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $pathPart)) { $url = $luaFilesBaseUrl . "/" . $pathPart; $dbConnect->addImage($id, $url); die("Uploaded"); } else { die("Error"); } } die("Error"); break; case 7: //update thumbnail $id = intval($_GET['lid']); if ($dbConnect->checkNameRight($id, $userId)) { $pathPart = "thumbnails/" . $id; if (move_uploaded_file($_FILES['file']['tmp_name'], $pathPart)) { die("Uploaded"); } else {