I have a few document libraries that have word documents in them, I have to find out the content types of those documents so that I can server them to a web browser that requests them. How do I do this from the SPListItem that I have in memory
I really need to solve this issue quickly, any help is greatly appreciated!

Get content type of a file
djchapin
NinetyNine
Do I use the SPContentType class
Thanks
XNA Rockstar
key: _Comments value:
key: Keywords value:
key: Subject value:
key: _Author value: Mark Macumber
key: ContentTypeId value: 0x0101009798DADD327F5C45AD5B47B267973C76
key: vti_approvallevel value:
key: _Category value:
key: ContentType value: Document
key: vti_title value: MICM
key: vti_parserversion value: 12.0.0.4518
key: pubic view value: 1
key: vti_cachedtitle value: MICM
key: vti_categories value:
key: vti_cachedcustomprops value: vti_approvallevel vti_categories Subject pubic\ view vti_assignedto Keywords vti_title _Author _Category ContentType _Comments
key: vti_author value: MARKV\administrator
key: vti_assignedto value:
key: vti_modifiedby value: MARKV\administrator
How can I use this data to server this file (which is a .doc file) to an end user
Note: these are properties of a SPListItem object, not a SPFile object.
Leo Fi
can you please give me more information about this How did you get that data and can I get that through the Object Model
Thanks for the help
Evil Booger
BPomidor
Thanks!!
Sunit Pinto
http://www.codeproject.com/dotnet/ContentType.asp
Look under the section title "The Registry to the Rescue- Again" it has code for a method that looks in the registry using the file extension to retrieve the content type.
encoded
To get the values of these fields from the object model use the syntax:
spListItemVar["File_x0020_Type"] as string
Escape
SPListItem item = ....
Does item.ContentType give you what you want If not that, then maybe item.File.Item.ContentType
// Richard
Steveinbeloit
There's theese fields in the document library that you can look at, I got them from the CAML viewer on the document library.
<FieldRef Name="File_x0020_Type" StaticName="File_x0020_Type" DisplayName="File Type" Type="Text" />
<FieldRef Name="HTML_x0020_File_x0020_Type" StaticName="HTML_x0020_File_x0020_Type" DisplayName="HTML File Type" Type="Text" /
Gied
Do you know if those registry entries are installed with Windows (if so, which version of windows, etc...) I would hate to write all this code and find out it only works with XP (for example) then install the site on a server 2003 machine.
Thanks again!