how to download a file ?

U

Une bévue

i'd like to know how to download a compressed file (4 to 15 mb) with
ruby, and how to choose the folder to receive it ???
 
R

rio4ruby

To follow up on the excellent suggestion by Kenosis ;) Here is how
Rio's copy-to operator could be used to download a file.

require 'rio'

rio(url) > rio('output_dir')

The post mentions that the file is compressed. If it is a gzipped file
and one wished to have an uncompressed local copy, something like the
following could be used.

rio(url_of_gzipped_file).gzip > rio('output_dir')


Cheers
-Christopher
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,209
Messages
2,571,085
Members
47,683
Latest member
AustinFairchild

Latest Threads

Top