On 11/9/06, John Hahn <jchahn / cox.net> wrote:
> Ok, here's a snippet of my code.
>
> @image_array = Array.new
> @image = File.open("test.JPG", "rb") do |image|
>         image.each_byte{|ch| @image_array << ch.to_s}
> end
> @temp = @image_array.pack("m*")
>

Correct me if I guess incorrectly here, but it looks like you want to
base64 encode a JPG image file. Ruby has a nice Base64 class which
will do this for you ...


require 'base64'
@temp = File.open("test.JPG", "rb") {|image| Base64.encode64( image.read )}


Blessings,
TwP