Blob Http Handler
In ASP.NET, if you need to display a blob (Binary Large Object) such as an image, a video or a file, you’ll need to provide an URL to your display control. When storing blobs in database, a standard practice is to create a web page such as a blob.aspx to which you provide the blob’s id as parameter and which the page will load and display so that you can set your display control’s source to that URL.
Actually, CodeFluent Entities automatically generates a HTTP Handler which precisely does all the work described previously: thanks to it you’ll retrieve an URL pointing to your blob and which you’ll be able to use in your display controls.
To use it you need to register it in your web.config file as:
<system.web> (...) <httpHandlers> (...) <add verb="GET" path="blobhandler.ashx" type="Sample.Web.HttpHandler, Sample, Version=126.96.36.199"/> </httpHandlers> (...) </system.web>
Note: Using IIS 7.x and the Integrated Pipeline mode, custom handlers should be added in the system.webServer/handlers section.
And there you go: you can now use this http handler to retrieve your blobs!
By the way, CodeFluent Entities also provides some extra controls (e.g. BinaryLargeObjectControl and the BinaryLargeObjectField) in its web runtime to let you easily display them in your ASP.NET web pages.