libURLDownLoadToFile

Peter Haworth pete at lcsql.com
Wed Aug 29 21:05:23 EDT 2012


Thanks Alex and Richard.

This is now working just fine.  I made so many changes, I really lost track
of what I might have been doing wrong before.

I plan on keeping my fingers crossed permanently!

Pete
lcSQL Software <http://www.lcsql.com>



On Wed, Aug 29, 2012 at 5:08 PM, Alex Tweedly <alex at tweedly.net> wrote:

> Create a new mainstack
> create a button in it
> put the following script into it
>    -- that should work
> change the file name to match the real example
>    --- see if that works
> change the URL to match your real example
>    -- see if that works.
>
> Then uncross your fingers :-)
>
> -- Alex.
>
>  --> all handlers
>>
>> on mouseUp
>>     local tURL, tFile
>>
>>     put "starting" into msg
>>     libUrlSetStatusCallback "update" , the long id of me
>>     put "junk.txt" into tFile
>>     put "http://tweedly.org" into tURL
>>     libUrlDownloadToFile tURL , tFile, "done"
>>     wait 5 seconds with messages
>>     put URL ( "file:" & tFile) after msg
>> end mouseUp
>>
>> on update
>>     put "updating" & CR after msg
>> end update
>>
>> on done
>>     local tFile
>>     put "junk.txt" into tFile
>>
>>     put URL ( "file:" & tFile) after msg
>>     put "done" & CR after msg
>> end done
>>
>
>
>
> On 29/08/2012 23:39, Peter Haworth wrote:
>
>> Still no joy with this.  I have switched over to using get URL and writing
>> it to a local disk file.  That works with exactly the same URL/local
>> filename but I don;t get the opportunity to update a progress bar.
>> Pete
>> lcSQL Software<http://www.lcsql.com>
>>
>>
>>
>> On Tue, Aug 28, 2012 at 3:57 PM, Peter Haworth<pete at lcsql.com>  wrote:
>>
>>  Thanks Andre, I'll give that a try.  Right before the download I
>>> mentioned, there is another download which worked OK but maybe resetting
>>> evrything after the initial download will help.
>>>
>>> Pete
>>> lcSQL Software<http://www.lcsql.com>
>>>
>>>
>>>
>>> On Tue, Aug 28, 2012 at 3:16 PM, Andre Garzia<andre at andregarzia.com>**
>>> wrote:
>>>
>>>  Pete,
>>>>
>>>> A previous transfer from the same host may have failed. Use a timeout to
>>>> issue a resetall and blow all the sockets to no mans land and try again.
>>>>
>>>> Cheers
>>>> andre
>>>>
>>>> On Tue, Aug 28, 2012 at 5:01 PM, Peter Haworth<pete at lcsql.com>  wrote:
>>>>
>>>>  Having a problem with this command.
>>>>>
>>>>> The url of the file to download looks fine (it's urlEncoded) and the
>>>>>
>>>> file
>>>>
>>>>> exists on the server.  Local filename also is fine.  I've set the
>>>>>
>>>> callback
>>>>
>>>>> message with libURLSetStatusCallback and in there I have logic that
>>>>>
>>>> updates
>>>>
>>>>> a progress bar.
>>>>>
>>>>> When the libURLDownloadToFile is executed, nothing ever reachs the
>>>>>
>>>> callback
>>>>
>>>>> message, progreess bar is not updated and the file is not downloaded.
>>>>>
>>>>   No
>>>>
>>>>> error message anywhere that I can see.
>>>>>
>>>>> Any obvious things I should be looking for?
>>>>>
>>>>> Pete
>>>>> lcSQL Software<http://www.lcsql.com>
>>>>> ______________________________**_________________
>>>>> use-livecode mailing list
>>>>> use-livecode at lists.runrev.com
>>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>>> subscription preferences:
>>>>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>>>
>>>>>
>>>>
>>>> --
>>>> http://www.andregarzia.com -- All We Do Is Code.
>>>> http://fon.nu -- minimalist url shortening service.
>>>> ______________________________**_________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>>
>>>>
>>>  ______________________________**_________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



More information about the use-livecode mailing list