PHP学院的中学生 2021-10-13 14:06:19 1103次浏览 0条回复 0 0 0

服务器端:

function download(){ 
 $full_path = 'pro/mp3/demo.mp3';

 $file_size = filesize($full_path);

 header("Content-type:audio/mpeg");
 header("Accept-Ranges:bytes");
 header("Accept-Length:$file_size");
 header("Content-Disposition:attachment;filename=demo.mp3");
 readfile($full_path);
 exit();
}
    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册