I have images stored in my database in a FILESTREAM and I am trying to find out what the best solution is to get that image back out into a web browser.
If I was managing the files on the file system myself, the quickest way would just be:
Response.TransmitFile(pathToFile);
This does not load the file into memory before transmitting it back to the client (to my understanding) and as such is nice and speedy.
I'm currently using Linq to SQL to get the FILESTREAM. This provides the FILESTREAM as a Binary object.
So far have this quite ugly way of doing it:
Response.WriteBinary(fileStreamBinary.ToArray());
Am I going to be better off not bothering with the Linq to SQL and doing things more directly?
I'm beginning to wonder why I bothered with FILESTREAM in the first place and didn't just stick to managing the files myself. I'm sure there was a reason for it without using the word "bandwagon"!