Hola,
 
estoy forzando a descargar archivos pero se bajan dañados.
Mantienen el nombre, tamaño y extension pero no se pueden visualizar o ejecutar.
Probe con imagenes, pdf, zip y ninguno funciona.  
 Código PHP:
    $temp_file = $filename;
$path = 'mistio.com/files';
$file = $path . '/' . $temp_file;
 
 
if (file_exists($file)) {
    header('Content-Description: File Transfer');
    header("Content-Type: application/force-download");
    //    header('Content-Type: application/octet-stream');
    header('Content-Disposition: attachment; filename='.basename($file));
    header('Content-Transfer-Encoding: binary');
    header('Content-Length: ' . filesize($file));
    header('Expires: 0');
    header('Cache-Control: must-revalidate');
    header('Pragma: public');
    ob_end_clean();
    flush();
    readfile($file);
    exit;
} else {
    echo ("No existe el archivo {$file}");
} 
    
  
Probe con application/force-download y application/octet-stream pero me da el mismo resultado.
Tambien probe poniendo ob_end_clean(); flush(); antes del readfile, tambien con ob_clean(); 
En q estoy fallando? 
Gracias