> let me guess! The image starts OK but then horizontal lines start to
> appear with degenerating colors? if so the data in DB is probably OK as
> long as you use MySql::quote(img_data) at insert time.

That was precisely the problem!

> Ok try this, select the image data and write it to disk,just an idea
> since I had once a similar problem.
> 
> res=@my.query("select pik from test where idpiks=1;")
> res.each{|r| img=r[0]} #well r[0] it's the actual image.
> File.open("e:/temp/test.jpg","wb").write(img)
> 
> now compare it, if it's OK then no upload problems or in db but at
> "browser display". If not make sure the #quote method is being used.
> 
> how I displayed the image
> imager.rb
> ...
> res=@my.query("select pik from test where idpiks=#{cgi.params['CID']};")
> res.each{|r| img=r[0]}
>    puts "Content-Type: image/jpeg"
>    puts "Content-Length: #{img.size}"
>    puts "Content-Title:MyTest.jpg"
>    puts
>    $stdout.binmode << img  #this is the culprit in windows, notice 'wb'
> mode in File#Write so #binmode, it drove me nuts back then, the answer
> was obvious...
> }
> 
> hope it helps
> Adartse
> 

Thanks for that solution as well.  I currently have it working using
Base64 encoding, so I may not switch it over, but thanks anyway.

And thanks to all for their help.