当前页面位置: » 丰搜网 » 文档中心 » 详细内容
在form域中post大于100k的数据
当表单发送的数据量很大时,就会报错。查阅msdn了解到,原因是微软对用request.form()可接收的最大数据有限制,iis4中为80k字节,iis5中为100k字节。
下面是微软网站的解决的几个方法:
request.form collection, use request.binaryread (request.totalbytes), and parse the form values from the output of request.binaryread. - use a file upload scheme, such as microsoft posting acceptor.
- break 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 "as is" 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.
<form method=post action=largepost.asp name=theformonsubmit="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. var formlimit = 102399 //get the value of the large input object. //(如果有中文,则要把102399改小一些,例如:51100) 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> the receiving active server page (asp) page reconstructs the variable:
<%dim bigtextareafor i = 1 to request.form("bigtextarea").count bigtextarea = bigtextarea & request.form("bigtextarea")(i)next%>来自:http://support.microsoft.com/default.aspx?scid=kb;en-us;q273482
出处:microsoft
责任编辑:51windows
◎进入论坛网络编程版块参加讨论
| | | 保持清晰的文档结构 | | | 月亮图腾教程ⅴ—最后一战 | | | x-sapce使用系列教程 | | | x-space安装系列教程 | | | 抽线以及虚线画法简明教程 | | | 创新设计 百万格子大楼 | | | discuz!转换系列教程 | | | 世界杯足球的32个变种 | | | 易上手简单图层样式扣图 | | | 一封写给mm学习linux的信 | | | | | | 保持清晰的文档结构 | | | 月亮图腾教程ⅴ—最后一战 | | | x-sapce使用系列教程 | | | x-space安装系列教程 | | | 抽线以及虚线画法简明教程 | | | discuz!转换系列教程 | | | 易上手简单图层样式扣图 | | | 十分钟学会 xajax | | | css 菜单举一反三 | | | 利用照片制作版画简明教程 | | | | | 蓝色理想版权申明:除部分特别声明不要转载,或者授权我站独家播发的文章外,大家可以自由转载我站点的原创文章,但原作者和来自我站的链接必须保留(非我站原创的,按照原来自一节,自行链接)。文章版权归我站和作者共有。
转载要求:转载之图片、文件,链接请不要盗链到本站,且不准打上各自站点的水印,亦不能抹去我站点水印。 特别注意:本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有 | | 本文现有 1 条评论 评分:- llllllllllllllllllll + 评分人数: 1 ,平均分: 3.00 anlei008 publish at 2005-8-11 15:31:31 评分3 明白了 | | |
| 关于站点 免责声明 联系站长 版权隐私 友情链接 网站地图 京icp备05002321号 | ©1999-2006 blueidea.com. 版权所有 | |