1
Reply

.wmv video files not playing in FormsAuthentication.

Ask a question
sri har

sri har

13y
1.5k
1

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)