如何解决下载pdf时遇到404错误页面
我认为这是一个权限问题,因为从管理页面下载 PDF 工作得很好。但是当我为用户复制代码时,我得到了一个 404 错误页面。
用户控制器 (Savepdf.php)
public function presult($id,$term)
{
if (!$this->rbac->hasPrivilege('student','can_view')) {
access_denied();
}
$data['title'] = 'Student Details';
$student = $this->student_model->get($id);
$data['student'] = $student;
$gradeList = $this->grade_model->get();
$class_id = $student["class_id"];
$studentSession = $this->student_model->getStudentSession($id);
$student_session_id = $studentSession["student_session_id"];
$student_session = $studentSession["session"];
$data['sch_setting'] = $this->sch_setting_detail;
$current_student_session = $this->student_model->get_studentsession($student['student_session_id']);
$data["session"] = $current_student_session["session"];
$data['principalmt_comment'] = $this->Mtcomment_model->GetPrincipalmtComment($id,$student_session_id);
$data['teacher_comment'] = $this->Comment_model->GetTeacherComment($id,$student_session_id);
$data['principal_comment'] = $this->Comment_model->GetPrincipalComment($id,$student_session_id);
$student_class_section = $this->student_model->currentClassSectionById($id,$student_session_id);
if($term == "first")
{
$data['subjectftScores'] = $this->getFirstTermResult($id,$class_id);
$view = $this->load->view('user/savepdf/first_term',$data,TRUE);
$title = $student['firstname'] . " " . $student['lastname']."First Term Result";
$filename = $student['firstname'] . "_" . $student['lastname']."_firstterm.pdf";
$this->show_pdf($view,$title,$filename);
}
}
查看
<a class="btn btn-primary" href="<?=site_url("savepdf/presult/".$student["id"]."/first")?>" download>Save as PDF</a>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。