{"id":215,"date":"2008-12-04T09:08:36","date_gmt":"2008-12-04T01:08:36","guid":{"rendered":""},"modified":"2014-02-27T23:00:25","modified_gmt":"2014-02-27T15:00:25","slug":"%e5%9c%a8form%e5%9f%9f%e4%b8%adpost%e5%a4%a7%e4%ba%8e100k%e7%9a%84%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"http:\/\/www.xiaoyebailong.com\/index.php\/2008\/12\/04\/215.htm","title":{"rendered":"\u5728Form\u57df\u4e2dPost\u5927\u4e8e100K\u7684\u6570\u636e"},"content":{"rendered":"<p>\u5f53\u8868\u5355\u53d1\u9001\u7684\u6570\u636e\u91cf\u5f88\u5927\u65f6\uff0c\u5c31\u4f1a\u62a5\u9519\u3002\u67e5\u9605MSDN\u4e86\u89e3\u5230\uff0c\u539f\u56e0\u662f\u5fae\u8f6f\u5bf9\u7528Request.Form()\u53ef\u63a5\u6536\u7684\u6700\u5927\u6570\u636e\u6709\u9650\u5236\uff0cIIS4\u4e2d\u4e3a80K\u5b57\u8282\uff0cIIS5\u4e2d\u4e3a100K\u5b57\u8282\u3002 <br \/>\n\u3000\u3000\u4e0b\u9762\u662f\u5fae\u8f6f\u7f51\u7ad9\u7684\u89e3\u51b3\u7684\u51e0\u4e2a\u65b9\u6cd5:<\/p>\n<p>Request.Form collection, use Request.BinaryRead (Request.TotalBytes), and parse the form values from the output of Request.BinaryRead. <br \/>\nUse a File Upload scheme, such as Microsoft Posting Acceptor. <br \/>\nBreak the HTML form variables into multiple form variables before you submit the form. The 102,399 byte limit is for each form variable, so you can have multiple form variables of 102,399 characters or less. The following sample code illustrates this: WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code &quot;as is&quot; without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and\/or fitness for a particular purpose. <br \/>\n&lt;FORM method=post action=LargePost.asp name=theForm<br \/>\nonsubmit=&quot;BreakItUp()&quot;&gt;<br \/>\n&lt;Textarea rows=3 cols=100 name=BigTextArea&gt;A bunch of text&#8230;<br \/>\n&lt;\/Textarea&gt;<br \/>\n&lt;input type=submit value=go&gt;<br \/>\n&lt;\/form&gt;<br \/>\n&lt;SCRIPT Language=JavaScript&gt;<br \/>\nfunction BreakItUp()<br \/>\n{<br \/>\n&nbsp; \/\/Set the limit for field size.<br \/>\n&nbsp; var FormLimit = 102399<br \/>\n&nbsp; \/\/Get the value of the large input object.<br \/>\n&nbsp; \/\/(\u5982\u679c\u6709\u4e2d\u6587,\u5219\u8981\u628a102399\u6539\u5c0f\u4e00\u4e9b,\u4f8b\u5982:51100)<br \/>\n&nbsp; var TempVar = new String<br \/>\n&nbsp; TempVar = document.theForm.BigTextArea.value<br \/>\n&nbsp; \/\/If the length of the object is greater than the limit, break it<br \/>\n&nbsp; \/\/into multiple objects.<br \/>\n&nbsp; if (TempVar.length &gt; FormLimit)<br \/>\n&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp; document.theForm.BigTextArea.value = TempVar.substr(0, FormLimit)<br \/>\n&nbsp;&nbsp;&nbsp; TempVar = TempVar.substr(FormLimit)<br \/>\n&nbsp;&nbsp;&nbsp; while (TempVar.length &gt; 0)<br \/>\n&nbsp;&nbsp;&nbsp; {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var objTEXTAREA = document.createElement(&quot;TEXTAREA&quot;)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objTEXTAREA.name = &quot;BigTextArea&quot;<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objTEXTAREA.value = TempVar.substr(0, FormLimit)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.theForm.appendChild(objTEXTAREA)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TempVar = TempVar.substr(FormLimit)<br \/>\n&nbsp;&nbsp;&nbsp; }<br \/>\n&nbsp; }<br \/>\n}<br \/>\n&lt;\/SCRIPT&gt;\u3000\u3000The receiving Active Server Page (ASP) page reconstructs the variable:<\/p>\n<p>&lt;%<br \/>\nDim BigTextArea<br \/>\nFor I = 1 To Request.Form(&quot;BigTextArea&quot;).Count <br \/>\n&nbsp; BigTextArea = BigTextArea &amp; Request.Form(&quot;BigTextArea&quot;)(I)<br \/>\nNext<br \/>\n%&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u8868\u5355\u53d1\u9001\u7684\u6570\u636e\u91cf\u5f88\u5927\u65f6\uff0c\u5c31\u4f1a\u62a5\u9519\u3002\u67e5\u9605MSDN\u4e86\u89e3\u5230\uff0c\u539f\u56e0\u662f\u5fae\u8f6f\u5bf9\u7528Request.Form()\u53ef\u63a5\u6536\u7684\u6700\u5927\u6570\u636e\u6709\u9650\u5236\uff0cIIS4\u4e2d\u4e3a80K\u5b57\u8282\uff0cIIS5\u4e2d\u4e3a100K\u5b57\u8282\u3002 \u3000\u3000\u4e0b\u9762\u662f\u5fae\u8f6f\u7f51\u7ad9\u7684\u89e3\u51b3\u7684\u51e0\u4e2a\u65b9\u6cd5: Request.Form c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-215","post","type-post","status-publish","format-standard","hentry","category-technology"],"_links":{"self":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/215","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/comments?post=215"}],"version-history":[{"count":1,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions"}],"predecessor-version":[{"id":66088,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/posts\/215\/revisions\/66088"}],"wp:attachment":[{"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/media?parent=215"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/categories?post=215"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/tags?post=215"},{"taxonomy":"topic","embeddable":true,"href":"http:\/\/www.xiaoyebailong.com\/index.php\/wp-json\/wp\/v2\/topic?post=215"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}