Forçar Download XML
Pessoal não estou conseguindo realizar o download de um arquivo XML meu. Vocês podem me ajudar?
Segue script que estou usando:
$file = "backup/".substr($notat['dataemissao'],0,6)."/".str_replace(" ","",$notat['chave_acesso'])."-protNFe.xml";
header("Content-type: application/save");
header('Content-Disposition: attachment; filename="' . str_replace(" ","",$notat['chave_acesso']). '-protNFe.xml' . '" ');
header('Expires: 0');
header('Pragma: no-cache');
readfile($file);
Meu readfile só printa na tela as informações.
Discussão (1)
Carregando comentários...