Possible Duplicate:
How can you read a files MIME-type in objective-c
In Cocoa, I am trying to get file type, I.E. JPG, JPEG, or PNG, using
LSCopyKindStringForURL((CFURLRef)URL, (CFStringRef *)&kind);
This helps only when the file extension is valid. However, if I rename a PNG file extension to JPEG, it returns JPEG, because LSCopyKindStringForURL returns file type from extension.
Is there any other method that will return me the exact type from the underlying contents of the file?