Posting <file> using libURLMultipartFormData - timeout?

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Ken3D
Posts: 16
Joined: Sun Mar 02, 2014 12:54 am

Posting <file> using libURLMultipartFormData - timeout?

Post by Ken3D » Fri Aug 01, 2014 10:06 pm

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Posting <file> using libURLMultipartFormData - timeout?

Post by Simon » Fri Aug 01, 2014 10:34 pm

socketTimeoutInterval maybe?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Ken3D
Posts: 16
Joined: Sun Mar 02, 2014 12:54 am

Re: Posting <file> using libURLMultipartFormData - timeout?

Post by Ken3D » Sat Aug 02, 2014 12:14 am

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.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Posting <file> using libURLMultipartFormData - timeout?

Post by Simon » Sat Aug 02, 2014 12:23 am

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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Ken3D
Posts: 16
Joined: Sun Mar 02, 2014 12:54 am

Re: Posting <file> using libURLMultipartFormData - timeout?

Post by Ken3D » Thu Aug 07, 2014 3:57 am

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10043
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Posting <file> using libURLMultipartFormData - timeout?

Post by FourthWorld » Thu Aug 07, 2014 5:48 am

Do you have success when using a standard browser as the client?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply