From: Markus Fischer Date: 2010-09-25T05:26:04+09:00 Subject: Re: Can't encode base64 for a jpg file Hi, I tried it out of curiosity and it worked with pack and encodet64 as well. This is ruby 1.9.2p0 on Ubuntu 10.04 64. I was able to use the tool "base64 -d" to decode the image data properly and view in gimp, as well undecode in PHP. $ cat test.png | ruby -e 'puts [STDIN.read].pack "m"' | php -r 'echo base64_decode(file_get_contents("php://stdin"));' >test2.png $ md5sum test.png test2.png f7fa630a147264f328e8b878ce7b39d9 test.png f7fa630a147264f328e8b878ce7b39d9 test2.png What version of ruby on which platform are you using? - Markus