problemas com header no IE
Fala galera
tô tentando criar um php que pega uma mp3 em outro server e envia para o usuario fazer download, usando o código abaixo, consegui fazer com que isso funcione no firefox, porem no internet explorer nao funcionou
PHP
[*]// append .mp3 onto he file name
[*]$name = addslashes($nmp3.".mp3");
[*]
[*]// make sure this thing doesn't cache
[*]header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
[*]header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
[*]header("Cache-Control: no-store, no-cache, must-revalidate");
[*]header("Cache-Control: post-check=0, pre-check=0", false);
[*]header("Pragma: no-cache");
[*]
[*]// create the necessary MP3 headers, this will type the page as MP3 and force download
[*]$len = filesize($nas_endereco."/Record/".$nmp3.".mp3");
[*]header("Content-type: audio/mpeg;\r\n");
[*]header("Content-Length: $len;\r\n");
[*]$head = "Content-Disposition: attachment; filename=\"$name\";\r\n";
[*]header($head);
[*]
[*]// hash the id to create the correct path
[*]$realpath = "/srv3/mp3/".md5("prefix_$id");
[*]
[*]// spit out the contents of the MP3 file to the browser
[*]readfile($realpath);
[*]
[*]
[*] $fp = fopen($nas_endereco."/Record/".$nmp3.".mp3","r");
[*] fpassthru($fp);
[*] fclose($fp);
[*]
Alguem tem ideia do que possa alterar para conseguir com que o IE faça o download da mp3?
Obrigado
Discussão (2)
Carregando comentários...