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
ElliotHC
Do I use the SPContentType class
Thanks
Grimal
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" /
Jo&#227;o da N&#243;brega
Thanks!!
omarmhd
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.
Doga Oztuzun
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
Jegant
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.
DanielN305517
LAE2
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!
gress
dafle
To get the values of these fields from the object model use the syntax:
spListItemVar["File_x0020_Type"] as string
Ingenious
SPListItem item = ....
Does item.ContentType give you what you want If not that, then maybe item.File.Item.ContentType
// Richard