I have a log file which gives correct formatting in Linux OS, but in windows it looses formatting. New line characters can't get read. I can only make changes at the time of reading/downloading file. Please suggest solution
if(isset($_REQUEST['download'])) {
$file = $dir . "/" . basename($_REQUEST['download']);
if (file_exists($file)) {
ob_start();
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($file));
header('Content-Transfer-Encoding: binary');
header("Pragma: no-cache");
header("Expires: 0");
header('Content-Length: ' . filesize($file));
ob_clean();
flush();
readfile($file);
exit;
}
}