I need to pull a file attachment from an InfoPath form, specifically a picture. I have some sample code to convert the picture from base64 to binary but you need to determine the type of file coming in (jpeg, bitmap, etc). Not sure how to code that. Can someone help me with an example of checking the header to determine file type ?