Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 FileStream

Author  Topic 

shapper
Constraint Violating Yak Guru

450 Posts

Posted - 2009-07-22 : 11:33:30
Hello,

I am planning to save files into an SQL 2008 database using FileStream.
When I retrieve the files in my C# code will I be able to know the file type?

I think that's done by getting the ContentType of the file.
What kind of object will I get on my C# code?
It is is a Stream then I think I will not be able to find the ContentType.
So I will have to add an extra column to my database table holding the ContentType of the file or not?

I am asking this because when I return the file for download I will need to know if it is a pdf, a gif, etc. Or not?

Thanks,
Miguel
   

- Advertisement -