views:

38

answers:

1

How can we send a large size of data (>2038 char) from client to Server using ajax?

I like to send an array of key-pair values of size more than 10KB. I am currently using cookies, is there any other prefered way by which we can send it through an Ajax Call.

+2  A: 

The 2038 or so max is for data sent as Get parameters. The solution is to use the Post call to your Ajax library. See your library's docs for info.

Otherwise, max is set by http server or framework. 10KB should not be a problem at all.

See http://stackoverflow.com/questions/124742/max-length-of-send-data-param-on-xmlhttprequest-post for more info.

Larry K
~2K is indeed a GET limitation in IE. FF goes up to ~8K however. The "safe" limit is 255 characters, anything beyond that should be sent over using POST.
BalusC