资源描述:
《关于asp中大字段在form中post出错的解析》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、关于ASP中大字段在Form中Post出错的解析这篇文章将会介绍到关于ASP中大字段在Form中Post出错的解析,希望对大家能够有帮助。我们在使用很多新闻系统的时候,都会发现一个问题,尤其是使用HtmlEdit从WORD文档中直接拷贝文章(尤其里面有复杂表格和文字)的时候,提交会有一个错误发生。“RequestObject,ASP0107(0x80004005)”很多编程人员都以为是access数据库备注字段64kb限制的问题,开始icech也以为是,但是后来用了其他新闻系统的SQL版本,同样的问题发生了。因此我猜想,可能是浏览器的问题。但是Form表单使用的都是Post方
2、式,应该和浏览器无关,那是什么原因呢?程序出错提示总是在(“xxx”)的地方,因此我判断,可能是Request有大小的限制。然后就去MSDN上查找“ASP0107(0x80004005)”,果然是Request的问题。微软的原文是这样的。PRB:Error“RequestObject,ASP0107(0x80004005)”WhenYouPostaFormTheinformationinthisarticleappliestmicrosoftActiveServerPagesThisarticlewaspreviouslypublishedunderQ273482SYMPTO
3、MSWhenyoupostalargeformfieldinMicrosoftInternetInformationServices,youmayreceivethefollowingerrormessage:ErrorType:Requestobject,ASP0107(0x80004005)Thedatabeingprocessedisovertheallowedlimit.WhenyoupostalargeformfieldinMicrosoftInternetInformationServer,youmayreceivethefollowingerrormessage
4、:Requestobjecterror‘ASP0107:80004005’StackOverflow/projectname/,lineXXThedatabeingprocessedisovertheallowedlimit.CAUSEThesizelimitofeachformfieldthatisretrievedintheRequestobjectis102,399bytes.Theerroroccurswhenyouexceedthislimit.RESOLUTIONToresolvethisproblem,useoneofthefollowingmethods:In
5、steadofreadingformvariablevalueswiththecollection,use(),andparsetheformvaluesfromtheoutputofUseaFileUploadscheme,suchasMicrosoftPostingAcceptor.BreaktheHTMLformvariablesintomultipleformvariablesbeforeyousubmittheform.The102,399bytelimitisforeachformvariable,soyoucanhavemultipleformvariables
6、of102,399charactersorless.Thefollowingsamplecodeillustratesthis:WARNING:ANYUSEBYYOUOFTHECODEPROVIDEDINTHISARTICLEISATYOUROWNRISK.Microsoftprovidesthiscode“asis”withoutwarrantyofanykind,eitherexpressorimplied,includingbutnotlimitedtotheimpliedwarrantiesofmerchantabilityand/orfitnessforaparti
7、cularpurpose.Abunchoftext...functionBreakItUp(){//Setthelimitforfieldsize.varFormLimit=102399//Getthevalueofthelargeinputobject.varTempVar=newStringTempVar=//Ifthelengthoftheobjectisgreaterthanthelimit,breakit//intomultipleobjects.if(>FormLimit){=(0,Form