Mabasa, Samantha, and Nafis - Fixed Bug 201 Unable to download an attachment from a student's submission (file name containing commas)

SIMPLICITY_Bug-189_Course_Delete_btn
Jeannick94 2021-05-05 17:49:16 +08:00
parent 70bfb834f3
commit aab5ce503a
1 changed files with 3 additions and 2 deletions

View File

@ -22,8 +22,9 @@ $time = time();
if ( (isset($_SESSION["user_student_id"]) && strpos($file, $_SESSION["user_student_id"])) || $_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") { if ( (isset($_SESSION["user_student_id"]) && strpos($file, $_SESSION["user_student_id"])) || $_SESSION['user_type'] == "Lecturer" || $_SESSION['user_type'] == "TA") {
// 发送文件头部 // 发送文件头部
header("Content-type: $type"); header("Content-type: $type");
header("Content-Disposition: attachment;filename=$filename"); header('Content-Disposition: attachment;filename="'.urldecode($filename).'"' );
header("Content-Transfer-Encoding: binary"); header("Content-Transfer-Encoding: binary");
header('Pragma: no-cache'); header('Pragma: no-cache');
header('Expires: 0'); header('Expires: 0');