- Home /
4k data limit on wwwform post?
On my iphone game I'm using WWWForm to send trace data to a url. Is there a 4k limit on the size of a request on ios?
If my trace data is above 4k I get "The network connection was lost" error coming back from the WWW request.
Is this a known limitation? I've read that there is a 4k limit on cookies in ios. Does WWWForm use cookies?!?
Thanks
If I recall correctly there's a general 4$$anonymous$$ limit on data sent with the WWW class.
There's something going on like that. I though a POST request would have been limitless but perhaps not on ios. I've reduced the amount of data I send. If I need more data I'll chunk it through a sequence of requests
Answer by GerryM · Nov 11, 2012 at 03:24 PM
You can upload more than 4k via WWWForm(), even on iOS, just tried it. I'm streaming a 25k file like this (inside a coroutine):
WWWForm postForm = new WWWForm();
postForm.AddBinaryData("theFile", buffer, localFileName, "text/plain");
WWW upload = new WWW(uploadURL,postForm);
yield return upload;
if (upload.error == null)
Debug.Log("Upload done: " + upload.text);
else
Debug.Log("Error during upload: " + upload.error);
Calling the upload only once, just needed to upload one file. $$anonymous$$aybe stacking too many calls might cause a problem.
Ah I was using postForm.AddField() which might work differently. I'll test it thanks.
Answer by DaveF · Sep 23, 2016 at 11:44 AM
Could it be your web server? I know I've had to adjust max. Allowed content settings on my IIS server to allow large pictures to be uploaded.