Write file as binary file

Otherwise, \n character will be converted to \r\n and break binary files, e.g. PNG.