Hi!
Hello Sven,
Thanks for considering Aspose.
I'm afraid I'm not familiar with the approach to get FileType information from FileStream object, but you can get help from the following code which returns the FileType information for a particular file over the hard-drive. In order to get FileType information, you've to check the database of MIMEs - whether they're mapped from extensions or you need to check information in windows registry.
[C#]
FileInfo fileInfo = new FileInfo(@"d:/pdftest/bugXLSnew22.xml");
string mimeType = "application/unknown";
RegistryKey regKey = Registry.ClassesRoot.OpenSubKey( fileInfo.Extension.ToLower());
if (regKey != null)
{
object contentType = regKey.GetValue("Content Type");
if (contentType != null)
mimeType = contentType.ToString();
}
MessageBox.Show(mimeType);
In you still face any issue while accessing the information from FileStream Object, you can temporarily save the file over some location and use the above code to get FileType information.
In case it does not satisfy your requirements or you've any further query, please feel free to contact.