I tried to implement also a HttpHandler for .jpg files.
I'm having a couple of problems:
- When debugging, the HttpHandler doesn't seem to fire.
- Only images that are not stored in Libraries are not visible anymore. All other images are still visible.
This is the code of my HttpHandler:
/// Summary description for CustomCmsImageHandler
CustomCmsImageHandler : ContentHttpHandler
ProcessContentItem(IContent content, HttpRequest request)
extension = VirtualPathUtility.GetExtension(HttpContext.Current.Request.Url.AbsolutePath);
, StringComparison.OrdinalIgnoreCase) && !content.MimeType.StartsWith(
And this is how I registered it inside my web.config:
Since I'm running the site on IIS7, .NET4.0, I also added a managed handler inside IIS7. This results in this change in my web.config:
I have exactly the same approach for .mp3 files, which works.
In the end I want to have some control on the images.
I'd like to create a URL like this:
Please, I really wants some help in this.