[Pharo-users] Downloading large files with a progress bar

Offray Vladimir Luna Cárdenas offray.luna at mutabit.com
Fri May 13 18:22:04 EDT 2016


Hi again,

Umm.... this is kind of strange. When I try with the Sven code 
downloading the Pharo, downloading progress bar works, but when I try 
the follow one, download works and forking lets me use the environment, 
as with Sven's but progress bar don't advance:

=================
OffshoreLeaksDB class >>downloadDatabase
     "I download the data of the panama papers from its page at the 
DataHub community repository:
     https://datahub.io/dataset/panama-papers
     "
     [[ :bar |
         bar title: 'Downloading Database...'.
             [
                 ZnClient new
                     url: 
'https://datahub.io/dataset/06f27df3-ec88-47ea-b428-7ec138f7835e/resource/50a9bda8-e44a-4aac-b265-d07fabde5612/download/offshore-leaks.sqlite.zip'; 

                     signalProgress: true;
                     downloadTo: FileLocator temp
             ]
                 on: HTTPProgress
                 do: [ :progress |
                     progress isEmpty ifFalse: [ bar current: progress 
percentage ].
                     progress resume ] ] asJob run ] fork.
=================

As an alternative I'm thinking in creating a Roassal animation for 
background processes, similar to the rolling circles in the browser, 
tablet of phone, to show that something is advancing, but you still need 
to wait... Anyway, if someone can tell me about why this is happening I 
will really appreciate it.

Thanks,

Offray

On 13/05/16 13:47, Offray Vladimir Luna Cárdenas wrote:
> Hi,
>
> On 13/05/16 00:35, Sven Van Caekenberghe wrote:
>>> On 13 May 2016, at 01:00, Offray Vladimir Luna Cárdenas 
>>> <offray.luna at mutabit.com> wrote:
>>>
>>> Hi Sven,
>>>
>>> Thanks for your quick answer. I tried both approaches but I'm 
>>> missing something. See my last attempt at 
>>> http://ws.stfx.eu/KBVBAP72IWOO with the last one.
>> That last code makes no sense and is not how the API is designed to 
>> be used.
>
> Sorry. I was tired and poking the code to see what was wrong. Your 
> example with fork and Pharo.sources work pretty well. I will implement 
> it.
>
> Thanks,
>
> Offray
>
>





More information about the Pharo-users mailing list