- Home /
Is there a maximimun number of fields for WWWForm.AddField?
Nothing is documented but I'm up to 1600-ish fields and I'm having problems. I didn't think this would be an issue as WWWForm uses POST doesn't it?
Cheers
Answer by grimmy · Oct 04, 2011 at 08:15 AM
I just did some tests and it looks like 1000 fields maximum.(At least php stops echoing data once I go past that mark). Is that right? I was hoping to save my save data files this way (to a database) but it doesn't look like that will be happening then.
Surely this should be documented somewhere right?,I just did some tests and php stops printing out data as soon as I try to add more than 1000 fields. Can this be correct??!
How do you check the returned data? Because TextFields have a 64k limit. Every string that is displayed in the Unity console has a limit of 64k most likely like the TextField components in Windows. I don't think they limit the fields-count. If there is a limit then probably a byte-limit. However, HTTP uses data-streams so there's no limit in the size you can send / receive. $$anonymous$$ost webservers / PHP configs have setup a limit to prevent overloading the webserver's memory.
I see no reason for Unity to limit the returned data. Have you checked www.bytes.length
?
If you have trouble to spot the error i recommend WireShark (a packet analyser) to see what get's actually transfered and what is returned.
I'm actually getting php to echo a single variable $dataLength which is the number of fields that I created in unity at runtime. The dataLength shows me a reading up until 999 addfields. It prints dataLength=999(I use saveData_post.text to print this single var in the console) If I create 1000 or more addfields in Unity then php just returns dataLength= (without a reading).
Unity doesn't have a field-count limitation (Just looked into the WWWForm class with ILSpy ;) ). $$anonymous$$ayby your web hoster limit the post-var-count like mentioned in this forum. To check this you could setup your own webserver (xitami is a nice one ;) ) and test it in a controlled environment.
I would recommend to merge the data into fewer fields and parse them in php. However there's also a max-post-size limit in php which is normally set to something between 8$$anonymous$$B and 512$$anonymous$$B but that's completely up to your hoster.
Your answer
Follow this Question
Related Questions
WWWForm always returning Internal Server Error 1 Answer
PHP POST through $_REQUEST with WEBBUILD 1 Answer
Retrieving varibale values from a php script? 1 Answer
How can I receive a WWWForm image using PHP? Example script 1 Answer
POST request using WWW class. error: necessary data rewind wasn't possible 2 Answers