在Form域中Post大于100K的数据
来源:互联网 发布:windows toolkit 2.7 编辑:程序博客网 时间:2024/05/17 05:07
当表单发送的数据量很大时,就会报错。查阅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 BigTextAreaFor I = 1 To Request.Form("BigTextArea").Count BigTextArea = BigTextArea & Request.Form("BigTextArea")(I)Next%> |
- 在Form域中Post大于100K的数据
- 在Form域中Post大于100K的数据
- 在Form域中Post大于100K的数据
- 在Form域中Post大于100K的数据
- 实现Form表单域中Post大于100K的数据
- asp:如何在Form域中Post大于100K字节的数据?我的方法如下:
- ASP:如何在Form域中Post大于100K字节的数据
- 实现form中post大于100K的数据的解决方案
- Form域中用Post提交容量大的数据
- Form域中用Post提交容量大的数据
- Form域中用Post提交容量大的数据
- Form域中用Post提交容量大的数据(ASP)
- Form域中用Post提交容量大的数据(转)
- curl POST的数据大于1024字节
- 字段数据大于64K的解决方案
- get/post 方式,form/数据的获取
- 为什么大于32k的数据就不行?
- 在数组中找到次数大于N/K的数
- .NET 将推动开源软件的发展
- COM开发拾粹<一>
- COM开发拾粹<二>
- 可编辑的 HTML JavaScript 表格控件 DataGrid
- 可编辑的 HTML JavaScript 表格控件 DataGrid II
- 在Form域中Post大于100K的数据
- 用Asp隐藏文件路径,实现防盗链
- 用Asp备份与恢复SQL Server 数据库
- 用Asp生成条形码
- [译]磁芯大战(Core War)的语言Redcode教程
- 我的第一本磁芯大战书(My First Corewar Book) 第一章
- ADO 物件的方法與屬性
- 蔡学镛:编译、反编译、反反编译
- 蔡学镛[散文随笔]:从A到E+