zoukankan      html  css  js  c++  java
  • 让火狐和chorme浏览器支持uploadify带Cookie上传

    /////////////////////让火狐和chorme浏览器支持uploadify上传/////////////////////////
    //jquery uploadify在ie下可以正常上传,在实现异步上传的时候,每一个文件在上传时都会提交给服务器一个请求。每个请求都需要安全验证,session和cookie的校验。是的,就是这样。由于jquery uploadify是借助flash来实现上传的,每一次向后台发送数据流请求时,ie会自动把本地cookie存储捆绑在一起发送给服务器。但firefox、chrome不会这样做,他们会认为这样不安全

    private void Application_BeginRequest(object sender, EventArgs e)
    {

    try
    {
    string session_param_name = "ASPSESSID";
    string session_cookie_name = "ASP.NET_SessionId";
    if (HttpContext.Current.Request.Form[session_param_name] != null)
    {
    UpdateCookie(session_cookie_name, HttpContext.Current.Request.Form[session_param_name]);
    }
    else if (HttpContext.Current.Request.QueryString[session_param_name] != null)
    {
    UpdateCookie(session_cookie_name, HttpContext.Current.Request.QueryString[session_param_name]);
    }
    }
    catch { }
    try
    {
    string auth_param_name = "AUTHID";
    string auth_cookie_name = System.Web.Security.FormsAuthentication.FormsCookieName;
    if (HttpContext.Current.Request.Form[auth_param_name] != null)
    {
    UpdateCookie(auth_cookie_name, HttpContext.Current.Request.Form[auth_param_name]);
    }
    else if (HttpContext.Current.Request.QueryString[auth_param_name] != null)
    {
    UpdateCookie(auth_cookie_name, HttpContext.Current.Request.QueryString[auth_param_name]);
    }
    }
    catch { }

    }

  • 相关阅读:
    delphi实现FTP下载
    delphi中ClientDataSet的隐含功能
    删除注册的ODBC
    ZOJ 1041 Transmitters
    POJ 3232 Accelerator
    POJ 3460 Booksort
    UVa 11552 Fewest Flops
    SOJ 8064 Whack the Groundhog
    BNU OJ 29355 手速为王
    POJ 3322 Bloxorz I
  • 原文地址:https://www.cnblogs.com/jordan2009/p/2988914.html
Copyright © 2011-2022 走看看