StuckInTheMiddle
Programmer
Hi Guys,
Did a forum search and couldn't find precisely I needed so hoping someone can help me out.
I would like to check/validate that the files my users submit to my ASP.NET website are valid MS Office documents.
Currently I am checking the file extension of the filename, easy enough, and i'm also making sure the file size is not something silly, but now my Boss wants us to verify that a file called test.doc really is a word document (and test.docx I guess for office 2007).
I couldnt find anything on the FileInfo object that would let be get to the filetype of the file.
I did see an old API example to do this but was hoping to avoid API calls if possible. Any help appreciated.
"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.
Did a forum search and couldn't find precisely I needed so hoping someone can help me out.
I would like to check/validate that the files my users submit to my ASP.NET website are valid MS Office documents.
Currently I am checking the file extension of the filename, easy enough, and i'm also making sure the file size is not something silly, but now my Boss wants us to verify that a file called test.doc really is a word document (and test.docx I guess for office 2007).
I couldnt find anything on the FileInfo object that would let be get to the filetype of the file.
I did see an old API example to do this but was hoping to avoid API calls if possible. Any help appreciated.
"If you can stay calm, while all around you is chaos...then you probably haven't completely understood the seriousness of the situation.