in reply to Re: CGI, write to file
in thread CGI, write to file

the comma after header, in particular, causes the Content-Type declaration to be printed in the wrong place
It shouldn't make any difference.