libUrlDownloadToFile doesn't work in LC 7.0

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

libUrlDownloadToFile doesn't work in LC 7.0

Post by FireWorx » Tue Dec 02, 2014 12:21 am

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
Last edited by FireWorx on Thu Jan 01, 2015 10:59 pm, edited 2 times in total.

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 7 Problem loading Internet Library?

Post by FireWorx » Wed Dec 17, 2014 7:04 pm

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.
Last edited by FireWorx on Thu Jan 01, 2015 10:59 pm, edited 1 time in total.

SparkOut
Posts: 2943
Joined: Sun Sep 23, 2007 4:58 pm

Re: LC 7 Problem loading Internet Library?

Post by SparkOut » Wed Dec 17, 2014 7:57 pm

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

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: LC 7 Problem loading Internet Library?

Post by FireWorx » Fri Dec 19, 2014 4:30 pm

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
Last edited by FireWorx on Thu Jan 01, 2015 11:01 pm, edited 1 time in total.

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: libUrlDownloadToFile doesn't work in LC 7.0

Post by FireWorx » Thu Jan 01, 2015 9:14 pm

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.

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: libUrlDownloadToFile doesn't work in LC 7.0

Post by FireWorx » Thu Jan 01, 2015 10:52 pm

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.

ToddFabacher
Posts: 280
Joined: Fri Jan 09, 2015 6:15 pm

Re: libUrlDownloadToFile doesn't work in LC 7.0

Post by ToddFabacher » Mon Jul 13, 2015 5:58 am

FYI..DO NOT Download the code sample above. It deletes files and access your address book

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: libUrlDownloadToFile doesn't work in LC 7.0

Post by Klaus » Mon Jul 13, 2015 11:57 am

Hi all,

OK, Todd's report sounded quite scary so I examined the stack! :shock:

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 8)


Best

Klaus

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: libUrlDownloadToFile doesn't work in LC 7.0

Post by Klaus » Mon Jul 13, 2015 2:15 pm

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 :D

@ 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! 8)


Best

Klaus
Attachments
Download Test LC 6.7_DISARMED.livecode.zip
(4.46 KiB) Downloaded 260 times

Post Reply