On 25/07/2012, at 12:47 PM, Monte Goulding wrote:

> From the release notes:
> 
> To download a url in the background, you can use:
> load url tMyUrl with message "myUrlDownloadFinished"
> Note that, the callback message received after a load url will be of the form:
> myUrlDownloadFinished url, status, data

Yep, that's exactly what I was doing, with the exception that I was getting the 
url from a local variable rather than from the url parameter in the handler.

Anyway, I moved the downloaded and save routine into the custom message handler 
and passed it the url from the parameter and I still got the same result. 
Attempting to put the - supposedly - downloaded and cached url (file) into a 
filepath that I specify triggers another download of the url.

Something's not quite right.

Terry...

> 
> On 25/07/2012, at 12:16 PM, Terry Judd wrote:
> 
>> Here's the problem - I'm downloading a document (pdf) and displaying a 
>> progress bar as I go. When the download is done I then display the document 
>> in a viewer. I'm using Monte's mergDoc external for this but I could just as 
>> easily be loading it into a browser object.
>> 
>> If I use the synchronous approach - put url pURL into url ("binfile:"&pPath) 
>> - then it works fine. My progress bar is updated in a urlProgress handler 
>> and when it completes I trap the 'downloaded' message in this handler to 
>> display the file.
>> 
>> Now, what I really want to do is to use the load command so that the 
>> download isn't blocking. However, if I do this then I get caught up in an 
>> endless loop.
>> 
>> If I use a custom message with the load command, like this...
>> 
>> load url pURL with message "pdfdownloaded"
>> 
>> and then in the pdfdownloaded handler do this...
>> 
>> put url pURL into url ("binfile:"&pPath)
>> 
>> Then this kicks off another download and the progress bar goes through its 
>> routine again. At the end of this second go the document displays as 
>> expected.
>> 
>> If however I don't use a custom message and I trap the 'downloaded' message 
>> in the urlProgress handler and try to put the loaded url into the 
>> destination file then it kicks off another download, and then at the end of 
>> that another - forever.
>> 
>> What am I doing wrong - or is this a Livecode problem?
>> Has anyone successfully implemented something along these lines that uses 
>> load url rather than put url?
>> 
>> Regards,
>> 
>> Terry...
>> 
>> 
>> Dr Terry Judd
>> Senior Lecturer in Medical Education
>> Medical Eduction Unit
>> Faculty of Medicine, Dentistry & Health Sciences
>> The University of Melbourne
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> [email protected]
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> --
> M E R Goulding 
> Software development services
> Bespoke application development for vertical markets
> 
> mergExt - There's an external for that!
> 
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

Dr Terry Judd
Senior Lecturer in Medical Education
Medical Eduction Unit
Faculty of Medicine, Dentistry & Health Sciences
The University of Melbourne





_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to