Zipfile download through CURL to an actual Zip-file in your file structure
I am using ruby 2.0
and my code is:
curl = Curl::Easy.new('http://somepage.cz/index.html')curl.on_body do |d| f = File.open('output_file.html', 'w') {|f| f.write(d)}endcurl.perform
I had to change File.new
to File.open
without this it didn't worked.Moving curl.perfom
on the end does helped me.