以下问题:我的服务器上有一个大文件(~2 2GB)。登录到我的站点的用户可以从我的服务器下载此文件。
不幸的是,我的服务器并没有那么强大。当许多用户同时下载这个文件时,他们的dl速度都非常慢。
因此,我将文件上传到google drive,并生成了一个直接下载链接:http://googledrive.com/host/[FILE_ID]
我的代码:
<?php
$remoteFile = 'http://googledrive.com/host/[FILE_ID]';
$filename = basename($remoteFile);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"$filename\"");
echo file_get_contents($remoteFile);
?>
我的问题是: file_get_contents()真的绕过了dl,还是这个文件正在通过我的服务器?如果是这样,那就没有意义了:
https://stackoverflow.com/questions/38205719
复制相似问题