主頁 > 知識(shí)庫 > 關(guān)于靜態(tài)頁生成問題 突破form數(shù)量限制

關(guān)于靜態(tài)頁生成問題 突破form數(shù)量限制

熱門標(biāo)簽:團(tuán)購網(wǎng)站 Linux服務(wù)器 Mysql連接數(shù)設(shè)置 科大訊飛語音識(shí)別系統(tǒng) 服務(wù)器配置 電子圍欄 阿里云 銀行業(yè)務(wù)
我們知道生成靜態(tài)頁,一般用模板的方式,這個(gè)我是會(huì)的,現(xiàn)在我想直接將ASP文件生成的HTML代碼存成靜態(tài)頁,這個(gè)非常適合做首頁,于時(shí)我在網(wǎng)上找這方面的內(nèi)容,找到這個(gè):《不用模板只用ASP+FSO生成靜態(tài)HTML頁的一個(gè)方法》:https://www.jb51.net/html/200609/984.htm,我試了一下,一般能辦,但文件大時(shí),就會(huì)出錯(cuò),到底是什么原因呢?是textarea存儲(chǔ)的文件有限制還是其他,反復(fù)上網(wǎng)查,同時(shí)在IECN發(fā)表帖子求助,我反復(fù)試驗(yàn),發(fā)現(xiàn)是表單有限制,在網(wǎng)上找到了解決FORM的限制問題,

下面是轉(zhuǎn)貼:

當(dāng)表單發(fā)送的數(shù)據(jù)量很大時(shí),就會(huì)報(bào)錯(cuò)。查閱msdn了解到,原因是微軟對(duì)用request.form()可接收的最大數(shù)據(jù)有限制,iis4中為80k字節(jié),iis5中為100k字節(jié)。 
  下面是微軟提供的幾個(gè)解決方法: 

1、用request.binaryread 代替 request.form方法 來解析表單數(shù)據(jù); 

2、使用文件上傳方案,比如:microsoft posting acceptor; 

3、由于102399字節(jié)的限制是對(duì)每個(gè)表單元素的,所以在提交時(shí),把表單元素內(nèi)容大于102399的分隔成多個(gè)表單元素來提交。 

下面為示例代碼:(微軟提醒:下面代碼不一定完全適用特定的需要,不對(duì)使用這些代碼產(chǎn)生的后果負(fù)責(zé)!) 
復(fù)制代碼 代碼如下:

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. 
//如果內(nèi)容有中文的字符的話,可以設(shè)置為: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> 



接受數(shù)據(jù)頁主要代碼: 


dim bigtextarea 
for i = 1 to request.form("bigtextarea").count 
bigtextarea = bigtextarea  request.form("bigtextarea")(i) 
next 
%> 

第一種也是有限制,我采用了第三種,終于成功了。  

標(biāo)簽:蚌埠 棗莊 衡水 衢州 廣元 萍鄉(xiāng) 大理 江蘇

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《關(guān)于靜態(tài)頁生成問題 突破form數(shù)量限制》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266