public function add() { $this->authority(51); if (isset($_FILES['document'])) { $file = $_FILES['document']; } else { $this->error(2); } if ($file['size'] > 2097152) { $this->errorMsg('文件大小不能超过2M'); } $doc_table = new DocumentTable(); $time = Util::get_datetime(); $id = $doc_table->insert($file['name'], $time); move_uploaded_file($file["tmp_name"], $this->location . $id . '_' . $file['name']); Util::go(URL . 'document/manage/'); }