libURLDownloadToFile and resume

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller, LCMark

Post Reply
monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1559
Joined: Fri Jan 13, 2012 1:47 am
Contact:

libURLDownloadToFile and resume

Post by monte » Fri Jun 21, 2013 5:31 am

Howdy... I'd like to enable libURLDownloadToFile to do resumes.... What's better, adding an offset parameter and assuming the httpHeaders are set or adding a boolean resume parameter and setting the range header and file offset... Main purpose is iOS at the moment but I think MCS_downloadurl is android too... I guess someone might want to add the feature to libURL for desktop...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3900
Joined: Sat Mar 24, 2007 2:54 am
Location: Palo Alto

Re: libURLDownloadToFile and resume

Post by Simon » Mon Jun 24, 2013 6:45 am

Hi Monte,
Just so you aren't feeling ignored.
Resume would be fantastic, is this http/s?

Personally I'm not so interested in iOS, but if it lead to the other platforms... Sweet!

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

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1559
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: libURLDownloadToFile and resume

Post by monte » Mon Jun 24, 2013 7:08 am

I've decided to work on a cross platform, non-engine solution using httpHeaders and .part.1..N files then concatenating them when I know I've got the whole file.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1559
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: libURLDownloadToFile and resume

Post by monte » Thu Jun 27, 2013 10:16 pm

I'm bumping into the lack of unload url to stop a download... I've had a look at the iOS side and I think if we add a static NSDictionary we can keep a handle on the NSURLConnection so that we have something to lookup when we want to unload... thoughts?
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1559
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: libURLDownloadToFile and resume

Post by monte » Fri Jun 28, 2013 5:27 am

Argh... now I've found this...http://quality.runrev.com/show_bug.cgi?id=10998... maybe I should resurrect mergHTTP after all...
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

monte
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1559
Joined: Fri Jan 13, 2012 1:47 am
Contact:

Re: libURLDownloadToFile and resume

Post by monte » Fri Nov 01, 2013 6:42 am

I'm back on this project where I'm downloading large files on mobile. Here's the good news:
- Bug 10998 was just a docs bug although it's quite quirky that there's different blocking behavior for libURLDownloadToFile on mobile
- I've worked out resume by manually appending files once I know I have all the parts of an interrupted download, would be nice if it were possible to open the file for binary append so it all just worked once you set the range header.

Here's the bad news:
- At the moment there's no cancel (unload url) option for loading urls which when you have large files moving around and devices potentially moving from wifi to cellular networks during the download does present a problem.

I'd probably happily implement unload url for everyone but for the life of me I can see how I would get an handle on the NSURLConnection or HttpURLConnection.
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Post Reply

Return to “Engine Contributors”