Home > Mobile >  Ruby on Rails - get file from URL
Ruby on Rails - get file from URL

Time:11-04

I'm Using Amazon Ads API which giving me a URL as a response... Opening that URL in browser, giving me a file that I need... Problem is I Don't know how to get the file from the URL in ruby... can anyone help me???

Thanks

CodePudding user response:

require 'open-uri'
contents = URI.open("https://hello.mdominiak.com").read

Documentation: https://ruby-doc.org/stdlib-3.1.2/libdoc/open-uri/rdoc/OpenURI.html

  • Related