In BlogEngine.NET, all files and images that are inserted on a post will be served using an HttpHandler. Actually, they are served by FileHandler and ImageHandler respectively. They are almost identically and they both share the same event model. For the purpose of this example, I’ll stick with the file handler but the examples will work for both.

Events

There are three events on the file handler.

  • BeforeServing
  • FileServing
  • BadRequest

BeforeServing
This event is fired before a file is served, no matter if it exists on disk or not.

FileServing
This event is fired when the file exists on disk and the handler is serving it to the requesting client.

BadRequest
This event is fired when the requested file does not exist on disk and therefore cannot be served.

Uses

The events are not used anywhere by BlogEngine.NET. They are there for plug-ins to take advantage of. It would be quite easy to build an HttpModule that listens to the FileServing event and logs the request for statistical purposes. Another module could listen to BeforeServing, so it could stop the request if it comes from another website. That way you can prevent deep links to your files. The BadRequest event can be used to log non-existing files so you can fix broken links.

This is just some of the possibilities that the FileHandler's events can be used for.

The difference between the ImageHandler and FileHandler has something to do with client-side caching and content-types. Other than that they are alike.

A lot of people have reported issues and inconveniences with the BlogEngine since the first release two days ago. I’ve fixed almost all of them and improved other things as well. These bug reports have made me realize two important things about the project:

1. There are still bugs
2. I have to fix them ASAP

First of all, I’ve fixed the bugs and made a new version (1.01) available for download. Get it here.

Second of all, the project needs a roadmap – a roadmap of features and bug fixes. I’ll get started on a detailed map that will be released after Easter when the BlogEngine.NET will have its own website. In the meanwhile I’m setting May 1st to be the deadline for the zero bug bounce and the completion of all promised features such as the best blog search on the planet.

Further more, the new dedicated website will have full documentation of the code and API’s for the engine. No date on that one yet, but before June 1st.

After listening to feedback and requests during the next 3-4 months followed by a series of interim releases, version 2.0 will be released before the end of the year.

This is the preliminary roadmap.