T
tinman77
Thanks in advance for everyone's help...
My problem is that more often than I would like, I get attachments
that for some reason or another do not include an extension. What I
want to do is create a C# app that based on a file on my hard drive
that I specify, will spit back to me the mime type. I can do the rest
from there.
I have looked, and looked and looked a little more for a way to
determine the type of a file that does not rely on the extension. So
far I have come up with next to nothing - a couple libraries that do
this but that's not what I'm looking for. I don't want to use a whole
extra just to find out what kind of file I have.
To clarify what I'm looking for, PHP has similar functionality using
the FileInfo class. Simple, easy and to the point. Does nothing like
this exist in C#? I have looked at different class on MSDN and
searched Google relentlessly but, I got nothing. I read something
about the Attachment class but I was having problems following the
documentation I found for it.
I have provided a general outline for the code I am looking for. Feel
free to correct me if my request is semi-outrageous.
myFile = "C:\screw-the-extension"
myFileObject = new File(myFile)
print myFileObject.MimeType
Any help is more than appreciated.
My problem is that more often than I would like, I get attachments
that for some reason or another do not include an extension. What I
want to do is create a C# app that based on a file on my hard drive
that I specify, will spit back to me the mime type. I can do the rest
from there.
I have looked, and looked and looked a little more for a way to
determine the type of a file that does not rely on the extension. So
far I have come up with next to nothing - a couple libraries that do
this but that's not what I'm looking for. I don't want to use a whole
extra just to find out what kind of file I have.
To clarify what I'm looking for, PHP has similar functionality using
the FileInfo class. Simple, easy and to the point. Does nothing like
this exist in C#? I have looked at different class on MSDN and
searched Google relentlessly but, I got nothing. I read something
about the Attachment class but I was having problems following the
documentation I found for it.
I have provided a general outline for the code I am looking for. Feel
free to correct me if my request is semi-outrageous.
myFile = "C:\screw-the-extension"
myFileObject = new File(myFile)
print myFileObject.MimeType
Any help is more than appreciated.