Php文件大小标头()

Php文件大小标头(),php,header,readfile,Php,Header,Readfile,我正在使用此代码从其他web服务器下载网站中的文件 如果我的url如下所示,则它会起作用:- $file_name = $_GET['name']; $file_url = $_GET['file-url'] . $file_name; header('Content-Type: application/octet-stream'); header("Content-Transfer-Encoding: Binary"); header("Content-disposition: attach

我正在使用此代码从其他web服务器下载网站中的文件

如果我的url如下所示,则它会起作用:-

$file_name = $_GET['name'];
$file_url = $_GET['file-url'] . $file_name;
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary"); 
header("Content-disposition: attachment; filename=\"".$file_name."\""); 
readfile($file_url);
exit;
因此,它通过从
http://www.googlevideo.com/video/play/221589
在我的网站中。现在,虽然它正确下载了文件,但它确实允许下载程序查看文件的实际大小。因此,有问题的下载者(如剩余时间、下载百分比等)

那么我应该用什么标题来解决这个问题呢?请通过编码进行解释。

您可以尝试以下方法:

https://www.example.com/file_download.php?name=video_song.mp4&file-url=http://www.googlevideo.com/video/play/221589
你可以试试这个:

https://www.example.com/file_download.php?name=video_song.mp4&file-url=http://www.googlevideo.com/video/play/221589

非常非常感谢!:)非常非常感谢!:)