HTTP download progress bar...HOWTO?
Alexander Lazarević
Alexander at lazarevic.de
Sun Jul 31 07:11:30 UTC 2005
Maybe it is also good to notice, that the method allocates a String
Buffer of file size length before starting to download. Depending on the
file size, your RAM and maybe vm memory settings, this could also lead
to a (very) long pause. So as an example the following might work on
your machine, but on mine the download never starts! :}
'http://debian.uni-essen.de/debian-cd/3.1_r0a/i386/iso-cd/debian-31r0a-i386-binary-1.iso'
asUrl retrieveContents
Alex
David Shaffer schrieb:
> Alexander Lazarević wrote:
>
>
>>I think you could change the following method in HTTPSocket to get a
>>progress display of any HTTP download.
>>
>>getRestOfBuffer: beginning totalLength: length
>>...
>> 'Downloading' displayProgressAt: Display center from: 0 to: length
>>during: [:bar|
>> [(response position < length) & (self isConnected | self
>>dataAvailable)]
>> whileTrue: [
>> bar value: response position.
>> (self waitForDataUntil: (Socket deadlineSecs: 5)) ifFalse: [
>>...
>>
>>
>>
>
> Thanks!
>
> David
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3192 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20050731/a45543b8/smime.bin
More information about the Squeak-dev
mailing list
|