SyntaxFix
Write A Post
Hire A Developer
Questions
Set content-type and other headers before you write the file out. For small files the content is buffered, and the browser gets the headers first. For big ones the data come first.