Mime Types

Posts   
 
    
jjnies
User
Posts: 66
Joined: 07-Nov-2007
# Posted on: 20-Nov-2007 21:22:10   

Hello all, I'm not sure if this is the proper place to enter this thread but here goes..

I am storing data from an InfoPath form through a webservice (using LLblGen Pro) to a SQL 2005 database. I am sending images over as base64binary using an image control that is used in InfoPath.

The part that I can't figure out is I have no idea what the mime type is of the file. It's encoded in base64 in my entity. Is there a way I can find out the file type or mime type from that? thanks!

jax

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 20-Nov-2007 23:12:49   

I would save the mime type when you pass the data from infopath to the service. your entity/dto would have (1) byte[] of the image (2) string of the mime type. the database would table would have 2 columns: varbinary imagedata, string mimetype.

when you (de)serialize the data you know what the file type is. this method would work for any file type, not just images.