// http://localhost/jiaxiao2/admin.php/Appstucoa/download/?File=F:/2.txt"
public function download(){
$file =I('File'); // 上传文件保存路径
if(is_file($file)) {
header("Content-Type: application/txt");
header("Content-Disposition: attachment; filename=".basename($file));
readfile($file);
}else{
$json['info'] = 'fail';
$json['status'] = C('STATUS_FAIL');
}
echo json_encode($json);
}
}
public function download(){
$file =I('File'); // 上传文件保存路径
if(is_file($file)) {
header("Content-Type: application/txt");
header("Content-Disposition: attachment; filename=".basename($file));
readfile($file);
}else{
$json['info'] = 'fail';
$json['status'] = C('STATUS_FAIL');
}
echo json_encode($json);
}
}