Page 1 of 1

Posting <file> using libURLMultipartFormData - timeout?

Posted: Fri Aug 01, 2014 10:06 pm
by Ken3D
I'm using the libURLMultipartFormData function to post a bunch of data to a webservice. I pass a bunch of parameter pairs (name part, name value) with one of them being a file I'm uploading (a zip) that is predicated with the required text: <file>. Everything works great with smaller files (seems like 10MB and smaller work fine) - and when it's done executing the "post" command and moves on to the next line of code that I have: "put the urlResponse into tURLContent" the ulrResponse is giving me the info of either error or success (in the form of a JSON file).

The problem is with the larger files. The website I'm uploading to shows that the file did indeed successfully upload, but the urlResponse is empty. I suspect that this is because LiveCode has a time limit on the "post" operations because they are blocking further execution of code and so LiveCode and isn't waiting around to receive the JSON. Does anyone have an idea if I might be correct? Is there a way to cause LiveCode to wait longer on a post blocking operation? Any other ideas on what the issue might be?

Thanks.

Re: Posting <file> using libURLMultipartFormData - timeout?

Posted: Fri Aug 01, 2014 10:34 pm
by Simon
socketTimeoutInterval maybe?

Simon

Re: Posting <file> using libURLMultipartFormData - timeout?

Posted: Sat Aug 02, 2014 12:14 am
by Ken3D
Thanks but that doesn't appear to be the solution. According to the dictionary the default for socketTimeoutInterval is 10 seconds. I tried doubling that to 20 seconds - but with my last test the upload finished/bailed out at 1 minute.

It could be that it isn't timing out at all - I just don't know, and can't understand why I get a JSON response when uploading smaller files but with larger ones no JSON - nothing - even though the file does end up being successfully uploaded.

Re: Posting <file> using libURLMultipartFormData - timeout?

Posted: Sat Aug 02, 2014 12:23 am
by Simon
Oh another thing you might try, drop a breakpoint in just before the "put the urlResponse into tURLContent" the ulrResponse and see what happens then.

Simon

Re: Posting <file> using libURLMultipartFormData - timeout?

Posted: Thu Aug 07, 2014 3:57 am
by Ken3D
Yeah, that's what I've been doing so I can hover over the tURLContent variable to see what value is - and it's been empty.

Re: Posting <file> using libURLMultipartFormData - timeout?

Posted: Thu Aug 07, 2014 5:48 am
by FourthWorld
Do you have success when using a standard browser as the client?