Php 从具有安全连接的服务器下载文件时出现问题
你好 面临从服务器下载文件的问题。有这样一个代码Php 从具有安全连接的服务器下载文件时出现问题,php,apache,Php,Apache,你好 面临从服务器下载文件的问题。有这样一个代码 function getFile($file) { if (file_exists($file)) { if (ob_get_level()) { ob_end_clean(); } header('Content-Description: File Transfer'); header('Content-Type: application/octet-stream');
function getFile($file)
{
if (file_exists($file))
{
if (ob_get_level())
{
ob_end_clean();
}
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=' . basename($file));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
if ($fd = fopen($file, 'rb'))
{
while (!feof($fd)) {
print fread($fd, 1024);
}
fclose($fd);
}
}
}
在本地计算机上,apache都表现得很好,标准窗口打开/保存文件。但是在战地服务器配置的安全连接(如apache)上,什么也没有发生
在Apache配置文件设置中,将重定向到https。也许整个过程都是在https中,在Apache配置文件中添加一行AddType应用程序/octet流。Xyz它怎么能赢
提前谢谢 问题解决了。整个捕获对共享目录的文件具有权限