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.
Posting <file> using libURLMultipartFormData - timeout?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Posting <file> using libURLMultipartFormData - timeout?
socketTimeoutInterval maybe?
Simon
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Posting <file> using libURLMultipartFormData - timeout?
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.
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?
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
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Posting <file> using libURLMultipartFormData - timeout?
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.
-
- VIP Livecode Opensource Backer
- Posts: 10043
- Joined: Sat Apr 08, 2006 7:05 am
- Contact:
Re: Posting <file> using libURLMultipartFormData - timeout?
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
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn