作者 lyh

gx

@@ -226,13 +226,11 @@ class FileController @@ -226,13 +226,11 @@ class FileController
226 public function downLoad(){ 226 public function downLoad(){
227 $file_model = new File(); 227 $file_model = new File();
228 $info = $file_model->read(['path' => str_replace_url($this->param['path'])]); 228 $info = $file_model->read(['path' => str_replace_url($this->param['path'])]);
229 - var_dump($info);  
230 - die();  
231 if ($info === false) { 229 if ($info === false) {
232 $this->response('指定文件不存在!', Code::USER_ERROR); 230 $this->response('指定文件不存在!', Code::USER_ERROR);
233 } 231 }
234 - $url = getFileUrl($info['path'],$info['is_cos']);  
235 - $fileName = basename($url); // 要保存的文件名 232 + $fileUrl = getFileUrl($info['path'],$info['is_cos']);
  233 + $fileName = basename($fileUrl); // 要保存的文件名
236 // 设置响应头 234 // 设置响应头
237 header('Content-Description: File Transfer'); 235 header('Content-Description: File Transfer');
238 header('Content-Type: application/octet-stream'); 236 header('Content-Type: application/octet-stream');