I need to use this in my rails program so I can get the image contents and then base64 it. I know how to base64 it but I just don't know how I would get the image. Anyone know how?
+2
A:
Edited to retrieve from external URL:
PHP:
$image = file_get_contents("http://www.site.com/file.png");
Ruby:
require 'net/http'
image = Net::HTTP.get_response(URI.parse("http://www.site.com/file.png")).body
jimyi
2009-09-20 22:46:32
Awesome, you are amazing. Thank you VERRYYY much.
deuces
2009-09-20 22:59:45