Page 1 of 1
libUrlDownloadToFile doesn't work in LC 7.0
Posted: Tue Dec 02, 2014 12:21 am
by FireWorx
I have an Apple approved stack that downloads some PDF map files from my web server to the special folder path documents folder. The script runs great in LC 6.6.4 and LC 6.7 but fails in LC 7.0. This is evident when testing it in both the simulator and on the iDevise.
Dave
Re: LC 7 Problem loading Internet Library?
Posted: Wed Dec 17, 2014 7:04 pm
by FireWorx
I guess no input means everyone is stumped. Looks like there is a bug in the standalone builder of LC 7.0. I guess I will look into the bug report process.
Re: LC 7 Problem loading Internet Library?
Posted: Wed Dec 17, 2014 7:57 pm
by SparkOut
I didn't see this before but I was under the impression that libUrl was not supported on iOS or android. Someone may chime in with more definite information
Re: LC 7 Problem loading Internet Library?
Posted: Fri Dec 19, 2014 4:30 pm
by FireWorx
Thanks for getting the discussion going. libUrlDownloadToFile has been working just fine all the way up to LiveCode 6.6.4. Thats my point and why I provided both stacks to demonstrate it. (see improved test stack attached to a post from me below) I filed a bug report with Live code and we will see where it goes.
Did you load it into the simulator and try it?
Thanks,
Dave
Re: libUrlDownloadToFile doesn't work in LC 7.0
Posted: Thu Jan 01, 2015 9:14 pm
by FireWorx
I have been busy on another project but I expect to drill down into this issue soon. My code downloads zipped folders from a web server and unpacks them on my IOS devise. When I figure out exactly where the script is failing I will report back. I believe libURLDownloadToFile works on mobile on LC 6.7 so possibly I can still deploy to IOS 8.1 via the 6.7 standalone builder? I hope so because I have clients that made the jump to IOS 8 and there is probably no easy way to go back to IOS 7. LC 6.7 seems to crash a lot on OS X Yosemite 10.10.1 though so I may just move up to LC 6.7 for the final build and testing.
It's a headache when you rebuild your app in the latest LC version to keep up with Apple and it no longer works and there is no documented reason why.
Re: libUrlDownloadToFile doesn't work in LC 7.0
Posted: Thu Jan 01, 2015 10:52 pm
by FireWorx
Ok I have something to report.
Livecode 6.7:
Both the libUrlDownloadToFile and the revZipOpenArchive TempFile, "read" commands work perfectly in Livecode 6.7 as they did in earlier versions so at least I can build for IOS 8.1. (although 6.7 seems to crash often on OS X Yosemite)
Livecode 7.0 build 10018
The libUrlDownloadToFile command FAILS. Not sure about the zip because nothing downloads to get unzipped
Livecode 7.0.1.10021 (RC 3) The latest download as of 2 days ago
libUrlDownloadToFile NOW WORKS. Yay ! However the revZipOpenArchive TempFile, "read" command FAILS.
I fixed up the example stack a little so it makes it easier to use. If you are interested in downloading zipped files from a web server and unpacking them on an IOS device then there is some worthy code for you to look at. There is also a nice little tool that lets you look into your specialfolderpath(documents) folder. Have fun loading the stack into the simulator in LC 6.7, 7.0, and 7.0.1 and look at all the different results you get. Start with 6.7 so you can see how it is supposed to work and then watch the failures on the more recent versions of Livecode.
Re: libUrlDownloadToFile doesn't work in LC 7.0
Posted: Mon Jul 13, 2015 5:58 am
by ToddFabacher
FYI..DO NOT Download the code sample above. It deletes files and access your address book
Re: libUrlDownloadToFile doesn't work in LC 7.0
Posted: Mon Jul 13, 2015 11:57 am
by Klaus
Hi all,
OK, Todd's report sounded quite scary so I examined the stack!
1. There is
NO hint that this stack does in fact access the users address book!
Todd, please check again!
2. The stack DOES delete all files from your "Documents" folder without asking!
But you need to click a button named "Delete files from Documents Folder".
But since this is an example stack that shows how to download and unzip archives from a server
on the MOBILE platform, this looks like a neccessary and understandable "cleanig routine" before
starting that example again.
So in this context the stack is working correctly in my opinion!
But showing a dialog BEFORE deleting the files would be a better idea!
In any case I am sure FireWorx did not want to do any harm and we could learn to never click
any suspicious/unknown button in any example stack unless we know what will happen
Best
Klaus
Re: libUrlDownloadToFile doesn't work in LC 7.0
Posted: Mon Jul 13, 2015 2:15 pm
by Klaus
Hi all,
a scond look a the stack showed that "on opencard" also all files in the DOCUMENTS folder get deleted,
so deleted the original stack and posted a DISARMED version of the stack.
No more problems with unwanted deleted files!
Hint:
If you want to build a Mobile standalone from the stack, then you should UNCOMMENT the last line of the
"opencard" script again, really (and only!) makes sense in that case
@ FireWorx
I will not comment this further, I am sure this was not intentional but rather a bit imprudent!
I think you know to be a tad more careful the next time AND add a WARNING in 72 point bold letters
to posted stacks that may do unwanted harm on the users machine!
Best
Klaus