locked
HTTPHandler problem with .swf RRS feed

  • Question

  • User1375053483 posted

    Hello all,

    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)
                    Util.CheckBandwidthStatus();
    
                if (HttpContext.Current.Application["Settings.Bandwidth.Archive.Status"] == "Off" && Request.FilePath.IndexOf("/swfs/player_Large.swf") > -1)
                    context.RewritePath("~/swf/overbandwidtharchivelar.swf");
                else if (HttpContext.Current.Application["Settings.Bandwidth.Archive.Status"] == "Off" && Request.FilePath.IndexOf("/swfs/player_Small.swf") > -1)
                    context.RewritePath("~/swf/overbandwidtharchivesma.swf");
    
            }
     Any help / suggests will be great. Many thanks.
    Monday, August 20, 2007 6:33 AM

Answers

  • User-1590039720 posted

    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:

    1. Click tool menu
    2. Select "Manage Add-ons" submenu
    3. You will see "Shockwave Flash Object"
    4. Disable it and click OK

    Hope it helpful to you.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 22, 2007 6:33 AM

All replies

  • User-1091210821 posted

    Hi there, please consult this thread http://forums.asp.net/t/1145594.aspx

     

    Good luck

    Monday, August 20, 2007 8:28 AM
  • User-1590039720 posted

    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:

    1. Click tool menu
    2. Select "Manage Add-ons" submenu
    3. You will see "Shockwave Flash Object"
    4. Disable it and click OK

    Hope it helpful to you.

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, August 22, 2007 6:33 AM
  • User1375053483 posted

    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.

    Monday, September 3, 2007 8:12 AM