Re: Download files from the web [message #86959 is a reply to message #86958] |
Tue, 17 December 2013 02:24   |
Helder Marchetto
Messages: 520 Registered: November 2011
|
Senior Member |
|
|
On Tuesday, December 17, 2013 10:59:06 AM UTC+1, Mats Löfdahl wrote:
> Den tisdagen den 17:e december 2013 kl. 10:51:07 UTC+1 skrev Helder:
>
>> On Tuesday, December 17, 2013 10:39:42 AM UTC+1, Mats Löfdahl wrote:
>
>>> Hm. But how to test what happens when the file exists on the server but does not get downloaded properly? Would be great if one could get the file size or even better a checksum from the server and then compare that with the same property of the downloaded file. But I don't see any of those properties listed here http://www.exelisvis.com/docs/IDLnetURL_Properties.html.
>
>>
>
>> Hi Mats,
>
>>
>
>> the files size is given in my example. Look at the output that I print out. For example:
>
>>
>
>> Check for update: Http: get: received (9594572), total expected (15501460)
>
>
>
> OK, so that is echoed during the transfer? Can you access the size information through some keyword?
Not that I know of (and trust me, I don't know much). However, it is included in the callback function. In my example from before, I used this info to make the progress bar. The size of the file is in progress[1] and the downloaded size is in progress[2].
If you only want to get the size, you could exit the callback function by returning a zero. However, this method far from being elegant. Therefore experience teaches: there must be a better way.
What you want to do is to check the directory content (size). I *think* that using some "url-get" method you will not get anywhere, because what you get is the html page.
Another idea would be to parse the html for "href" content. To do this, the web page must contain a listing of the available files.
Let me know if you come up with better ideas.
cheers,
h
|
|
|