【发布时间】:2015-07-16 23:24:45
【问题描述】:
说实话:我找到了从 s******d 下载 mp3 文件的方法,但我无法直接下载 MP3,所有音乐都在浏览器中流式传输。
我已经尝试过这样的事情
<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>
但我的下载链接不是.mp3,这是我下载文件的代码行
href="<?php echo $val['stream_url']?>?client_id=67739332564a7130c3a05f90f2d02d2e">Descargar</a>.
当我使用该选项时
direct_download.php?file=
只需下载一个具有该名称的文件
client_id=05b4f2000dad27aa9fc48d08915d7830.html
我使用的完整php代码是
<?php
$file = $_GET['file'];
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".$file.";");
header("Content-Length: ".filesize($file));
readfile($file);
exit;
?>
可以像这样在任何锚点中访问:
<a href="direct_download.php?file=fineline.mp3">Download the mp3</a>
你能帮我吗,或者如果你有更好的想法,谢谢你们
【问题讨论】:
-
你让自己面临Local File Inclusion 漏洞。
-
你只是允许下载任何文件......我可以简单地做
direct_download.php?file=../etc/passwd,你会遇到很多麻烦。