修复已知错误

This commit is contained in:
win7 committed 2019-12-26 12:50:14 +08:00
1 parent e190c100b2
commit 626e63597e
5 files changed
+49 -53

No files matched your search

+8 -22
View File
@@ -75,30 +75,16 @@ class Fields extends BaseController
$fl = new FL;
// 查询文件信息
$filist = $fl->where('id',$id)->find();
if($filist->oldname == null)
{
$oldname = $filist->newname;
}else{
$oldname = $filist->oldname;
}
$url = public_path().'public\\uploads\\'.$filist->url;
$name = $filist->oldname;
// 临时代替代码
if(!file_exists($url))
{
echo "文件找不到";
return true;
}else{
header('content-type:text/html;charset=utf8');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($url));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Length:'.filesize($url));
readfile($url);
}
$data = ['msg'=>'数据上传成功','val'=>1];
// return download($url,$name);
return smDownload($url,$oldname);
}