Downloading file with Zinc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Downloading file with Zinc

Stephane Ducasse-3
Hi Sven

I would like download files (pdf) with Zinc (not opening them in Pharo).
I wonder how I can do it with zinc.

Tx

Reply | Threaded
Open this post in threaded view
|

Re: Downloading file with Zinc

Jimmie Houchin-5
On 12/20/18 1:59 PM, Stephane Ducasse wrote:
> Hi Sven
>
> I would like download files (pdf) with Zinc (not opening them in Pharo).
> I wonder how I can do it with zinc.
>
> Tx

'http://files.pharo.org/books-pdfs/learning-oop/2018-04-01-LearningOOP.pdf' 
asZnUrl saveContentsToFile: '/mypath/mydir/learning-oop.pdf'

Should get you going.

Jimmie



Reply | Threaded
Open this post in threaded view
|

Re: Downloading file with Zinc

CyrilFerlicot
In reply to this post by Stephane Ducasse-3


On Thu 20 Dec 2018 at 21:00, Stephane Ducasse <[hidden email]> wrote:
Hi Sven

I would like download files (pdf) with Zinc (not opening them in Pharo).
I wonder how I can do it with zinc.

Hi,

Here is a snippet with a progress bar if you want to give feedback to the user:



Tx

--
Cyril Ferlicot
https://ferlicot.fr
Reply | Threaded
Open this post in threaded view
|

Re: Downloading file with Zinc

Sven Van Caekenberghe-2
In reply to this post by Jimmie Houchin-5


> On 21 Dec 2018, at 05:25, Jimmie Houchin <[hidden email]> wrote:
>
> On 12/20/18 1:59 PM, Stephane Ducasse wrote:
>> Hi Sven
>>
>> I would like download files (pdf) with Zinc (not opening them in Pharo).
>> I wonder how I can do it with zinc.
>>
>> Tx
>
> 'http://files.pharo.org/books-pdfs/learning-oop/2018-04-01-LearningOOP.pdf' asZnUrl saveContentsToFile: '/mypath/mydir/learning-oop.pdf'
>
> Should get you going.
>
> Jimmie

There is also ZnClient>>#downloadTo:

ZnClient new url: ''; downloadTo: ''.

Read the comment


Reply | Threaded
Open this post in threaded view
|

Re: Downloading file with Zinc

Stephane Ducasse-3
Tx
This is strange since I looked for download and the system did not
show it to me.

Stef

On Fri, Dec 21, 2018 at 9:55 AM Sven Van Caekenberghe <[hidden email]> wrote:

>
>
>
> > On 21 Dec 2018, at 05:25, Jimmie Houchin <[hidden email]> wrote:
> >
> > On 12/20/18 1:59 PM, Stephane Ducasse wrote:
> >> Hi Sven
> >>
> >> I would like download files (pdf) with Zinc (not opening them in Pharo).
> >> I wonder how I can do it with zinc.
> >>
> >> Tx
> >
> > 'http://files.pharo.org/books-pdfs/learning-oop/2018-04-01-LearningOOP.pdf' asZnUrl saveContentsToFile: '/mypath/mydir/learning-oop.pdf'
> >
> > Should get you going.
> >
> > Jimmie
>
> There is also ZnClient>>#downloadTo:
>
> ZnClient new url: ''; downloadTo: ''.
>
> Read the comment
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Downloading file with Zinc

Sven Van Caekenberghe-2


> On 21 Dec 2018, at 21:55, Stephane Ducasse <[hidden email]> wrote:
>
> Tx
> This is strange since I looked for download and the system did not
> show it to me.
>
> Stef

Open Spotter, type 'download', click implementors, look at the end or filter on 'Zn'.

The #saveContentsToFile: is used in snippet number 18 of Elegant Pharo Code, https://medium.com/concerning-pharo/elegant-pharo-code-bb590f0856d0 (already from 2014).

> On Fri, Dec 21, 2018 at 9:55 AM Sven Van Caekenberghe <[hidden email]> wrote:
>>
>>
>>
>>> On 21 Dec 2018, at 05:25, Jimmie Houchin <[hidden email]> wrote:
>>>
>>> On 12/20/18 1:59 PM, Stephane Ducasse wrote:
>>>> Hi Sven
>>>>
>>>> I would like download files (pdf) with Zinc (not opening them in Pharo).
>>>> I wonder how I can do it with zinc.
>>>>
>>>> Tx
>>>
>>> 'http://files.pharo.org/books-pdfs/learning-oop/2018-04-01-LearningOOP.pdf' asZnUrl saveContentsToFile: '/mypath/mydir/learning-oop.pdf'
>>>
>>> Should get you going.
>>>
>>> Jimmie
>>
>> There is also ZnClient>>#downloadTo:
>>
>> ZnClient new url: ''; downloadTo: ''.
>>
>> Read the comment
>>
>>
>