sri har

sri har

  • NA
  • 166
  • 1.7k

.wmv video files not playing in FormsAuthentication.

Sep 16 2011 11:03 AM

Hi All,

Issue is .wmv video files not playing in FormsAuthentication. for public .wmv files working fine.

I have a forms authentication for .wmv files , i was used the below code in global.asax file, its working fine in local m/c through Visualstudio2010.

when i am  uploading to server (IIS7) sqlserver2005,i given .wmv file direct link(http://domainname/partner-files/videos/en/Content-in-a-Box-Webinar-20110713-1502-1.wmv) in browser its redirecting to login page then after username password given, its giving the following error

"Windows Media Player encountered a problem while playing the file. For additional assistance, click Web Help."

can any one pls help me on this issue.

<script runat="server" language="c#">

void Application_PreSendRequestHeaders(Object source, EventArgs e)

{

      HttpApplication app = (HttpApplication)source;

     

      HttpCookieCollection cookies = app.Context.Response.Cookies;

      if (cookies != null)

      {

        foreach(string name in cookies)

        {

          HttpCookie cookie = cookies[name];

            if (cookie.Name.Equals(FormsAuthentication.FormsCookieName, StringComparison.OrdinalIgnoreCase))

            {

                  cookie.HttpOnly = false;

                  break;

            }

        }

      }

}

</script>


Answers (1)