in reply to Download file to browser
Well, if you do not know the file type, assume MIME type "application/octet-stream". It's basically the same as saying to the User Agent (a browser in your case): "Here's some binary stuff of unspecified type".