nginx和apache的header写反了, 这里header后面要写相对地址,不能用绝对地址.
parent
c25eeab991
commit
bdcae66485
|
@ -1041,14 +1041,19 @@ function file_put_out($file,$download=-1,$downFilename=false){
|
||||||
//调用webserver下载
|
//调用webserver下载
|
||||||
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
|
$server = strtolower($_SERVER['SERVER_SOFTWARE']);
|
||||||
if($server && $GLOBALS['config']['settings']['httpSendFile']){
|
if($server && $GLOBALS['config']['settings']['httpSendFile']){
|
||||||
|
if(substr($file, 0, strlen(DATA_PATH)) == DATA_PATH){
|
||||||
|
$relativePath = substr($file,strlen(dirname(DATA_PATH)));
|
||||||
if(strstr($server,'nginx')){//nginx
|
if(strstr($server,'nginx')){//nginx
|
||||||
header("X-Sendfile: ".$file);
|
header('X-Accel-Redirect:'.$relativePath);
|
||||||
}else if(strstr($server,'apache')){ //apache
|
|
||||||
header('X-Accel-Redirect: '.$file);
|
|
||||||
}else if(strstr($server,'http')){//light http
|
|
||||||
header( "X-LIGHTTPD-send-file: " . $file);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
|
}else if(strstr($server,'apache')){ //apache
|
||||||
|
header('X-Sendfile:'.$relativePath);
|
||||||
|
return;
|
||||||
|
}else if(strstr($server,'http')){//light http
|
||||||
|
header( "X-LIGHTTPD-send-file: " . $relativePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//远程路径不支持断点续传;打开zip内部文件
|
//远程路径不支持断点续传;打开zip内部文件
|
||||||
|
|
Loading…
Reference in New Issue