[Pharo-users] Zinc downloadTo: help required

Sven Van Caekenberghe sven at beta9.be
Thu Jul 19 15:09:32 EDT 2012


Chris,

On 19 Jul 2012, at 20:21, Chris wrote:

> I'm trying to do a wget style download with Zinc but running into a few problems when a server uses chunked transfer encoding. Eventually it ends up in ZnUtils streamFrom:to:size: with an empty totalSize (as content-length is unset) and then produces an empty file. However the download works fine if I simply do an upToEnd on the ZnChunkedReadStream. This can be seen by executing ZnClient new url: 'http://www.google.com'; downloadTo: '/tmp/foo.txt'.
> 
> Thanks
> Chris

Yes, this seems to be a problem: your analysis is correct, since the size is unknown upfront - the whole idea of chunked transfer -, #streamFrom:to:size: in its current version cannot work. I will look at this tomorrow, I am pretty sure this can quite easily be fixed (minus the progress bar).

Thanks for reporting this.

Regards,

Sven

--
Sven Van Caekenberghe
http://stfx.eu
Smalltalk is the Red Pill





More information about the Pharo-users mailing list