Hello,
what's the best way to download an image and save it?
My current code is:
temp_file = Tempfile.new "filename", "#{RAILS_ROOT}/tmp/"
temp_file.puts open(path_to_picture, 'User-Agent' => 'Test').read
mimetype = `file -ib #{temp_file.path}`.gsub(/\n/,"")
But it seems, that the mimetyp isn't ok.
Best regards