in reply to very simple question...

I do this a lot and I agree with he last comment. You must print the Content-type first. The puzzle to me is why it worked on the kiosk.