Download.php: remove the redundant space before the closing parenthesis ')'.
parent
a2d80ffa6e
commit
8b40765c17
|
@ -8,7 +8,7 @@ session_start();
|
||||||
|
|
||||||
// 修改这一行设置你的文件下载目录
|
// 修改这一行设置你的文件下载目录
|
||||||
$file = "./../../lrr_submission".$_GET['file'];
|
$file = "./../../lrr_submission".$_GET['file'];
|
||||||
$filename =basename($file);
|
$filename = basename($file);
|
||||||
|
|
||||||
// 判断文件是否存在
|
// 判断文件是否存在
|
||||||
if(!file_exists($file)) die("File does not exist.");
|
if(!file_exists($file)) die("File does not exist.");
|
||||||
|
@ -22,9 +22,8 @@ $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="'.urldecode($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');
|
||||||
|
|
Loading…
Reference in New Issue