PDA

View Full Version : 4k Limit on info passed to/from TextField


nyghtrunner
11-04-2009, 04:13 PM
Hey all!

So I was talking to a colleague of mine today, and he asked me sort of an odd question, and I'm hoping you guys can help me get sorted out... Google has kind of failed me on this.

Anyway, we were talking about hooking up a Flex app to a server via Ruby, and he mentioned something about there being a limit to the amount of info that can be passed to a TextField (Input/Dynamic) using this method. It certainly stands to reason that there is SOME limit, but he had mentioned 4k in terms of info (not characters). I also assume he meant only where communication with the dbase was concerned, not the textField itself.

This struck me as something of a surprise, and certainly something I'm not aware of, so I was hoping one of you might be able to help me clear this up.

Is there a limit to the amount of info that can be passed to an editable textField that anyone knows about? I'm more of a Flash guy, not a Flex guy, but I've done some stuff with Flex, and they use the same language (essentially, I know MXML is different, but if memory serves, that gets converted to AS3 at compile time anyways)... I'm not aware of any hard limit concerning the amount of data that can be passed to/from a field, but then I don't usually have text fields that would send/receive that much info anyways...

The only thing I could really find was this:

http://www.kirupa.com/forum/archive/index.php/t-16877.html

But judging by the date, that's dealing with Flash in AS2 (Around the time of MX 2k4) and Flex hadn't been released at that point (Flex 1 release March 2004)...

Anyway, if anyone has any info on this, I'd love to hear it! :)

CyanBlue
11-04-2009, 04:32 PM
I think he was talking about the limit on how many characters you can pass via POST which is somewhere around 4K... You can put more texts than 4K in a textField though... Of course, that somewhat slows down the Flash Player if you have big chunk of data stored in it...

nyghtrunner
11-04-2009, 05:33 PM
I think he was talking about the limit on how many characters you can pass via POST which is somewhere around 4K... You can put more texts than 4K in a textField though... Of course, that somewhat slows down the Flash Player if you have big chunk of data stored in it...

Thanks Cyan!

Just to be clear, it's an issue with POST, not with Flex itself being unable to actually POST more than that (IE - Is this true for POST commands, regardless of which platform/language they are made from? Or something native to Flex itself)?

Doing some quick research on limits in POST via HTTP, it looks like it should be able to handle a lot more than that, but I'm certainly not an expert in this field. :(

wvxvw
11-04-2009, 06:31 PM
Nah, I'm positve about sending and receiving MUCH bigger amounts of data then that via POST. I mean megabytes, not Kilobytes...
Anyway, where did this value of 4K came from?
Here's some oldish info about Flash limits:
http://kb2.adobe.com/cps/144/tn_14437.html
In case you need it.
However, I'm positive about TextField being capable of showing more characters then what would 4K translate to...
var s:String = "";
var l:int = 0x1000; // 4Kb
while (l--)
{
s += String.fromCharCode(
0x20 + ((Math.random() * 0x5E) >> 0)); // put random ASCII char
}
s += "\rYou shoudl not see this line, in case the limit is 4K";
var tf:TextField = new TextField();
tf.width = 600;
tf.height = 400;
tf.multiline = true;
tf.wordWrap = true;
tf.text = s;
this.addChild(tf);
// and scroll all the way down...

CyanBlue
11-04-2009, 06:40 PM
Um... I don't really recall where I have heard that, but I probably heard that from this forum... :p

Yes, the POST itself does not have limitation, but the browser probably has some sort of limitation when they implements this... I guess that maybe have something to do with what I remember...

wvxvw
11-04-2009, 10:02 PM
GET has limitations, but sure not POST. Think of you uploading files, well, even as an attachement to this forum - sure you can upload way much more then 4K, and that sure uses POST.

nyghtrunner
11-04-2009, 10:45 PM
Well, I'm sure that there's SOME sort of limitation, most likely based off the browser prefs... Doesn't seem like it could be limitless, as that would get into timeout issues, I would think.

What you say makes sense, though. I was really thinking more about when concerning Flex, and specifically the text boxes when POSTing... When I heard him say that, I know I got the puzzled look on my face, because it really didn't sound like any kind of issue I'd heard of. And surely, if it were true, then google would have told me, because that's a really small size in this day and age, and I would think that the limitation would bug the heck out of the developers.

Regardless, thanks for the responses guys! :)

wvxvw
11-05-2009, 12:39 AM
I think that a single TCP packet cannot be bigger then 4.5Kb... would it make sense?
AFAIK, maximum upload size set in default PHP.ini is 5Kb. The default one for the .NET httpRuntime is 4Mb. (Sure both are configurable). The maximum length of GET request, according to MSDN is 1024 bytes (1Kb).
So, 4 Kb is just a pretty Hex number ( 0x1000 ), but it doesn't fit into any known limitation... not as far as one can tell...

CyanBlue
11-05-2009, 02:56 PM
a single TCP packet cannot be bigger then 4.5Kb
Hm... Interesting...