0

I'm searching for a way to download an URL with an image as binary so I can BASE64 Encode it and send it to my SAP Database. All this using RAILS.

BenMorel
  • 31,815
  • 47
  • 169
  • 296
FastSolutions
  • 1,749
  • 1
  • 22
  • 48

1 Answers1

0

After I tried different things, I think the Curb gem is the best solution. This gem is found here: Ruby Gems Curb

It was easy to use like this:

curl_profile_pic = Curl::Easy.perform("example.url.jpeg)
params["personal_info"]["profile_pic"] = Base64.encode64(curl_profile_pic.body_str)
FastSolutions
  • 1,749
  • 1
  • 22
  • 48