HTTP download progress bar...HOWTO?
Alexander Lazarević
Alexander at lazarevic.de
Sat Jul 30 06:20:13 UTC 2005
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: [
...
David Shaffer schrieb:
> Is there a way to hook a progress bar to an HTTP download? I'm trying
> to make an installer for Squellenium and when it downloads the zip the
> long pause is disconcerting. Here's how I'm downloading:
>
> downloadSelenium
> ^ ZipArchive new readFrom: (self seleniumZipURI retrieveContents
> contentStream binary; yourself)
>
> So I send retrieveContents to a HttpURL. I did a cursory hunt through
> the image but couldn't turn up anything (I did find lots of progress bar
> examples but nothing connected with HTTP).
>
> 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/20050730/f66740ec/smime.bin
More information about the Squeak-dev
mailing list
|