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);
            }

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

  • 相关阅读:
    SCHTASKS /CREATE
    手机酷派4G5316 5313s 黑砖 求转成功 9008端口 9006端口 少走弯路选对镜像
    网络共享 相关知识与原理 操作步骤
    电脑 主板 硬盘的 电脑系统
    按键精灵 按键代码
    win7 快捷键 收集
    默认主页更改 主页锁定 打开浏览器时的网页设置
    按键精灵 以时间命名文件夹 创建文件 写入文件 和截图
    按键精灵-----按钮控制(开始子程序)的时候是要用到多线程的
    java web 大总结
  • 原文地址:https://www.cnblogs.com/zevfang/p/3998789.html
Copyright © 2011-2022 走看看