[Pharo-users] Zinc downloadTo: help required
cpmbailey at btinternet.com
Thu Jul 19 16:47:59 EDT 2012
On 19/07/2012 20:09, Sven Van Caekenberghe wrote:
> 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'.
> 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.
Thanks a lot Sven.
More information about the Pharo-users