zoukankan      html  css  js  c++  java
  • swfupload 相关配置

    部署在IIS上出现404:

    修改 C:WindowsSystem32inetsrvconfigapplicationHost.config 文件

    连续查找requestFiltering,往下添加一行                        

    <requestLimits maxAllowedContentLength="1073741824" />

    里面的1073741824=1G。

    <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
         <fileExtensions allowUnlisted="true" applyToWebDAV="true">
           ................
         </fileExtensions>
    </requestFiltering>

     或者在本地web.config添加下面代码

    <configuration> 
     <system.webServer> 
       <security>
          <requestFiltering>
            <requestLimits maxAllowedContentLength="1073741824" />
          </requestFiltering>
        </security>
     </system.webServer>
    </configuration>

    另一种 404的可能性:

    路径要添加绝对路径http://www.xxxx.com/swfupload/…… 或者 http://192.168.1.34/swfupload/……

     flash_url: "http://www.xxxx.com/swfupload/swfupload.swf",
     upload_url:  "http://www.xxxx.com/swfupload/imageUp.ashx",
     button_image_url: "http://www.xxxx.com/swfupload/up.png",

    Web.Config要添加节点:

    maxRequestLength的大小根据自己的需求设置1024000~=1G

      <system.web>
               <httpRuntime maxRequestLength="1024000" executionTimeout="360" requestValidationMode="2.0" />
      </system.web>

    post_params 参数的设置:

    因SWFUpload上传需要自己开辟Session 所以要在Globals中添加处理

    post_params: {
        "ASPSESSID": "<%=Session.SessionID %>",
        "AUTHID": "<%=Request.Cookies[FormsAuthentication.FormsCookieName].Value%>" //微软MemberShip
    },

    Globals.asax文件添加

    Application_BeginRequest内添加

                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 (Exception)
                {
                    HttpContext.Current.Response.StatusCode = 500;
                    HttpContext.Current.Response.Write("Error Initializing Session");
                }
    
                try
                {
                    string auth_param_name = "AUTHID";
                    string auth_cookie_name = 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 (Exception)
                {
                    HttpContext.Current.Response.StatusCode = 500;
                    HttpContext.Current.Response.Write("Error Initializing Forms Authentication");
                }
            void UpdateCookie(string cookie_name, string cookie_value)
            {
                HttpCookie cookie = HttpContext.Current.Request.Cookies.Get(cookie_name);
                if (cookie == null)
                {
                    cookie = new HttpCookie(cookie_name);
                    HttpContext.Current.Request.Cookies.Add(cookie);
                }
                cookie.Value = cookie_value;
                HttpContext.Current.Request.Cookies.Set(cookie);
            }

    ---------------------如果以上都注意了,基本应该没什么问题

  • 相关阅读:
    从zk监控canal-client消费延迟情况
    python面向对象——类的参数
    python面向对象——类的继承
    python并发——进程间同步和通信(二)
    python并发——线程池与进程池(转)
    python从指定目录排除部分子目录——用于删除目录
    python并发统计s3目录大小
    Java对象的序列化和反序列化
    多态、抽象类和接口
    Java输入输出流
  • 原文地址:https://www.cnblogs.com/zevfang/p/3998789.html
Copyright © 2011-2022 走看看