Last post Sep 03, 2007 08:12 AM by gwpreston
Aug 20, 2007 06:33 AM|gwpreston|LINK
I am having trouble trying to get working a Webhandler that I am trying to use to stop me running over my bandwidth every month when people are viewing the flash videos on my web site. This is my first webhandler that I have created and is prob the best
way in doing within .NET. I have entered the relevant configs into the web.config (<add verb="*" path="*.swf" type="ConstantComedy.SwfHandler" />) and created a class inside the app_code folder called SwfHandler. I am also using ASP.NET AJAX on some other
parts of the web site and I have mapped the .swf extension in IIS6 to .NET. The problem that I am having is when .NET calls the SwfHandler, its seens that the ProcessRequest method isn't doing anything with the request even with or without me adding in my
own code into the method (it just doesn't load the flash in). This is the method that I have created in the SwfHandler class.
public void ProcessRequest(HttpContext context)
HttpRequest Request = context.Request;
HttpResponse Response = context.Response;
Response.ContentType = "application/x-shockwave-flash";
if (HttpContext.Current.Application["Settings.Bandwidth.LiveFeed.Status"] == null || HttpContext.Current.Application["Settings.Bandwidth.Archive.Status"] == null)
if (HttpContext.Current.Application["Settings.Bandwidth.Archive.Status"] == "Off" && Request.FilePath.IndexOf("/swfs/player_Large.swf") > -1)
else if (HttpContext.Current.Application["Settings.Bandwidth.Archive.Status"] == "Off" && Request.FilePath.IndexOf("/swfs/player_Small.swf") > -1)
Aug 20, 2007 08:28 AM|naturehermit|LINK
Hi there, please consult this thread
Aug 22, 2007 06:33 AM|david8021|LINK
Hi gwpreston ,
Because IE has been installed flash control, it can run swf file automatic. If you want to httphandler swf file, you have to disable the flash control.
I have tried a test, it works fine.
How to disable flash control:
Hope it helpful to you.
Sep 03, 2007 08:12 AM|gwpreston|LINK
thanks for your help guys but i'm still have a problem trying to get this webhandler to work. Still not sure what is going on.