|
...
|
...
|
@@ -229,16 +229,8 @@ class FileController |
|
|
|
if ($info === false) {
|
|
|
|
$this->response('指定文件不存在!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
if($info['is_cos'] == 1){
|
|
|
|
$cos = new CosService();
|
|
|
|
$fileUrl = $cos->getImageUrl($info['path']);
|
|
|
|
}else{
|
|
|
|
$fileUrl = $this->config['root'].$info['path'];
|
|
|
|
if (!is_file($fileUrl)) {
|
|
|
|
$this->response('指定文件已被系统删除!', Code::USER_ERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$fileName = basename($info['path']); // 要保存的文件名
|
|
|
|
$fileUrl = getFileUrl($info['path'],$info['is_cos']);
|
|
|
|
$fileName = basename($fileUrl); // 要保存的文件名
|
|
|
|
// 设置响应头
|
|
|
|
header('Content-Description: File Transfer');
|
|
|
|
header('Content-Type: application/octet-stream');
|
...
|
...
|
|