Ciao
Sono un nuovo iscritto e desidero sottoporvi questa questione:
Devo fare il download di un file binario (estensione .ov2). con Il modulo php ho impostato queste istruzioni :
<?php
session_cache_limiter('none'); //*Use before session_start()
session_start();
$file = "report_out.ov2";
_Download("../../public/".$file, $file);
function _Download($f_location,$f_name){
header ("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Length: ' . filesize($f_location));
header('Content-Disposition: attachment; filename=' . basename($f_name));
readfile($f_location);
}
?>
Purtroppo il risultato e' il contenuto del file a video anziche il download del file stesso (non si apre il popup con il bottone: "salva"). Il codice php funziona correttamente in locale (sul mio web server IIS) ma non funziona ad host.
Qualcuno ha gia' avuto problemi del genere ? come si puo' forzare il download del file ?
Grazie
ciao
Alessandro