in reply to (z) Re: base64 encoding
in thread base64 encoding

I also am looking for a simple way to base64 a file. I have a small mail module that sends formatted e-mails via sendmail and I want to add the ability of sending attachmnets. The code you posted looks like the answer; question:- is the old_encode_base64 sub expecting a file to be read in line by line or should the whole file be slurped up into one scalar variable and the sub called with that variable?

Replies are listed 'Best First'.
(z) Re^3: base64 encoding
by zigdon (Deacon) on Feb 27, 2003 at 14:10 UTC

    I believe you're expected to slurp the whole file you want to encode, and hand it over to the sub. Depending on the filesize, it might hurt your machine though. I'm not sure, but I doubt you can encode a file line by line and get the same result.

    -- zigdon