$f = fopen('export.csv', "w"); $csv = "test"; fwrite($f,$csv) or die("Not wtite"); header("Content-type: csv/plain"); header("Content-Disposition: attachment; filename=export.csv"); header("Content-length:".(string)(strlen($csv))); Скачивает файл с нулевым размером... Подскажите, что нужно исправить?
PHP: header("Content-type: csv/plain"); header("Content-Disposition: attachment; filename=export.csv"); $fn=fopen('export.csv' ,"r"); fpassthru($fn); fclose($fn); так сделай.