Practice ASP to submit ultra-long articles ~

Source: Internet
Author: User

main idea:
the request value of ASP is only 102399 bytes, which is equivalent to more than 50 thousand Chinese characters. The SQL text field can be stored much greater than this value. The string of the script (vbs/JS) is almost infinite (2 billion ). Only request is the bottleneck, so you can submit articles separately, mainly using JavaScript on the client, divide the value into several textarea. On the server, separate request values are combined and submitted to the database.
refer to Code :
client:

Function dealwithbigdoc ()
{
VaR formlisubmit = 102399;
VaR totaldoc = new string;
Totaldoc = Document. All. xxnr. value;
If (totaldoc. length> formlimit)
{
While (totaldoc. length> 0)
{
VaR objxxnr = Document. createelement ("textarea ");
Objxxnr. value = totaldoc. substr (0, formlimit );
Document. thisfrm. appendchild (objxxnr );
Totaldoc = totaldoc. substr (formlimit );
}
}
}

Server :( written by jsript)

function myrequest ()
{< br> var xxnr = "";
for (I = 1; I <= request. form ("xxnr "). count; I ++)
{< br> xxnr + = request. form ("xxnr") (I);
}< br> xxnr = xxnr. tostring ();
xxnr = xxnr. replace (/[/']/g ,"''"). replace (// n/g ,""). replace (// R/g, "");
// xxnr = server. htmlencode (xxnr);
return xxnr. tostring ();
}< br>
comment list
no problem with 0.4 million words tested ~
however, it is best to change server. scripttimeout
JOURNAL boy @ 23:23:03
IIS 6 can change the total request size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.