Estimados,
Tengo un problema al detectar el mime type con archivos xls y xlsx , con otro tipo de archivos funciona perfecto , lo que mi script hace es detectar el mimetype para luego asignarlo al forzar la descarga.
Código PHP:
Ver original $tipo = FILEINFO_MIME_TYPE($path);
}
//var_dump($tipo);
//}
if ($tipo == '') {
$tipo = "application/force-download";
}
// Leer cabeceras
header("Content-Type: $tipo"); header("Content-Disposition: attachment; filename=$archivo"); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . $tamano); // Descargar Archivo
} else {
die('El archivo que indicaste no existe!!'); }
Espero , puedan ayudarme .
Saludos