Commit 2ad976eb authored by zhuwei's avatar zhuwei

ceshi

parent c69a3a44
......@@ -199,4 +199,23 @@ class News extends Basic
$m_file->updateDateById($this->params['file_id'], ['status'=>1]);
return $this->response(200, '删除成功');
}
public function downloadFile() {
$filepath = '/static/business_school_file/20181203/20181203110021473.jpg';
if(file_exists($filepath)){
header("Content-type:application/octet-stream");
$filename = basename($filepath);
header("Content-Disposition:attachment;filename = 11.jpg");
header("Accept-ranges:bytes");
header("Accept-length:".filesize($filepath));
readfile($filepath);
}else{
echo "<script>alert('文件不存在')</script>";
}
}
}
\ No newline at end of file
......@@ -370,6 +370,7 @@ Route::group('index', [
'getRecordsList' => ['index/broker/getRecordsList', ['method' => 'post|get']],//解绑或绑定经纪人设备id
'downloadFile' => ['index/news/downloadFile', ['method' => 'POST']], //新增商学院资讯
]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment