זה עשה את העבודה:
<?php
$url = 'https://www.call2all.co.il/ym/api/DownloadFile?&token=oKGdVae4&path=ivr2:/M0000.wav';
//$url = $_GET['file'];
$path_parts = pathinfo($url);
$ext = $path_parts['extension'];
$filename = $path_parts['filename'];
header("Content-type: application/$ext");
header("Content-Disposition: attachment; filename=$filename.$ext");
$stream = fopen('php://output', 'w');
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_READFUNCTION, function($ch, $fd, $length) use ($stream) {
return fwrite($stream, fread($fd, $length));
});
curl_exec($ch);
curl_close($ch);
exit();
//echo file_get_contents($url);
//file_put_contents(fopen("php://output", "w"), fopen($url, 'r'));
רק אצטרך לראות בהמשך שזה משתלב בJS בדפדפן להשמעת הקבצים


)
