Hi guys, I'm writing a code to download the csv file from my website. It's work perfect but some time I click on the download button, it didn't pop up to download a CSV file but it's popup to download a .php file. Some time it's doesn't popup anything but it's display the html code on the screen. It's wild, I don't know what is going on. Is there anyone experienced this problem before. Here's my header: header('Content-Description: File Transfer'); //header("Content-type: application/csv"); header("Content-type: application/octet-stream"); header('Content-Disposition: attachment; filename='.basename($fname)); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: ' . filesize($fname)); ob_clean(); flush(); readfile($fname); PHP: Much appreciated your help and ideas. Cheers. Nau