I have images stored in my database in FILESTREAM, and I'm trying to figure out what the best solution is to return this image to a web browser.
If I myself managed files in the file system, the fastest way would be:
Response.TransmitFile(pathToFile);
This does not load the file into memory before transferring it back to the client (as far as I know), and, as such, is nice and fast.
I am currently using Linq for SQL to get FILESTREAM. This provides FILESTREAM as a binary.
So far, this pretty ugly way to do this is:
Response.WriteBinary(fileStreamBinary.ToArray());
Is it better for me not to worry with Linq to SQL and do something more directly?
, FILESTREAM . , , " "!