用户操作
[即时聊天] [发私信] [加为好友]
李海华ID:51windows
1956次访问,排名2万外好友0人,关注者0
51windows的文章
原创 4 篇
翻译 0 篇
转载 0 篇
评论 24 篇
最近评论
文章分类
    收藏
      相册
      Link
      51windows.Net
      存档
      软件项目交易
      订阅我的博客
      XML聚合  FeedSky
      订阅到鲜果
      订阅到Google
      订阅到抓虾
      订阅到BlogLines
      订阅到Yahoo
      订阅到GouGou
      订阅到飞鸽
      订阅到Rojo
      订阅到newsgator
      订阅到netvibes

      原创 在Form域中Post大于100K的数据收藏

      新一篇: 用Asp隐藏文件路径,实现防盗链 | 

        当表单发送的数据量很大时,就会报错。查阅MSDN了解到,原因是微软对用Request.Form()可接收的最大数据有限制,IIS4中为80K字节,IIS5中为100K字节。

        下面是微软提供的几个解决方法:

      1、用Request.BinaryRead 代替 Request.Form方法 来解析表单数据;

      2、使用文件上传方案,比如:Microsoft Posting Acceptor;

      3、由于102399字节的限制是对每个表单元素的,所以在提交时,把表单元素内容大于102399的分隔成多个表单元素来提交。

      下面为示例代码:(微软提醒:下面代码不一定完全适用特定的需要,不对使用这些代码产生的后果负责!)

      <FORM method=post action=LargePost.asp name=theForm onsubmit="BreakItUp()">
      <Textarea rows=3 cols=100 name=BigTextArea>A bunch of text...</Textarea>
      <input type=submit value=go>
      </form>
      <SCRIPT Language=JavaScript>
      function BreakItUp()
      {
        //Set the limit for field size.
        //如果内容有中文的字符的话,可以设置为:51100
        var FormLimit = 102399
        //Get the value of the large input object.
        var TempVar = new String
        TempVar = document.theForm.BigTextArea.value
        //If the length of the object is greater than the limit, break it
        //into multiple objects.
        if (TempVar.length > FormLimit)
        {
          document.theForm.BigTextArea.value = TempVar.substr(0, FormLimit)
          TempVar = TempVar.substr(FormLimit)
          while (TempVar.length > 0)
          {
            var objTEXTAREA = document.createElement("TEXTAREA")
            objTEXTAREA.name = "BigTextArea"
            objTEXTAREA.value = TempVar.substr(0, FormLimit)
            document.theForm.appendChild(objTEXTAREA)
            
            TempVar = TempVar.substr(FormLimit)
          }
        }
      }
      </SCRIPT>
            

      接受数据页主要代码:

      <%
      Dim BigTextArea
      For I = 1 To Request.Form("BigTextArea").Count 
        BigTextArea = BigTextArea & Request.Form("BigTextArea")(I)
      Next
      %>

      发表于 @ 2004年03月02日 10:17:00|评论(loading...)|编辑

      新一篇: 用Asp隐藏文件路径,实现防盗链 | 

      评论:没有评论。

      发表评论  


      当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
      Csdn Blog version 3.1a
      Copyright © 51windows