MIME::Base64 troubles 
Author Message
 MIME::Base64 troubles

i'm forwarding a message i sent to Lincoln Stein last week. I suspect
he's been having too much holiday fun to have time for random support
email :)

--

* brian moseley *
{ perl warrior | agent of chaos => critical path }

------- Start of forwarded message -------

Subject: Re: New version of CGI.pm

X-Criticalpath-Sent: 24 Dec 1997 16:07:28 GMT



Date: 24 Dec 1997 08:07:28 -0800

Quote:
>  > 3) does anybody know what the proper forum is for asking questions about
>  > MIME::Base64? i sure hope it's something better than comp.lang.perl.misc.

> I've used it a bit.  What's the question?

i'm writing a web-based mail client. for some reason, my base64-encoded

attachments aren't being decoded properly by other clients, although
they are handled correctly by my client.

as an example, i attached the same jpg to a composition in eudora and a

composition in my client and sent both messages to a shell account so i
could save each message as a folder with pine. interesting results.

these are the headers for and the first few lines of the attachment, for
each message.

from eudora:

--=====================_882595579==_
Content-Type: application/octet-stream; name="Bridesmd.jpg"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="Bridesmd.jpg"

/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAFlAMgDASIA
AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA

and from my web client:

------------=_882566924-17652-3
Content-Type: image/jpeg; name="Bridesmd.jpg"
Content-Disposition: attachment; filename="Bridesmd.jpg"
Content-Transfer-Encoding: base64

LzlqLzRBQVFTa1pKUmdBQkFRRUJMQUVzQUFELzJ3QkRBQWdHQmdjR0JRZ0hC
d2NKQ1FnS0RCUU5EQXNMCkRCa1NFdzhVSFJvZkhoMGFIQndnSkM0bklDSXNJ
eHdjS0RjcExEQXhORFEwSHljNVBUZ3lQQzR6TkRMLwoyd0JEQVFrSkNRd0xE
QmdORFJneUlSd2hNakl5TWpJeU1qSXlNakl5TWpJeU1qSXlNakl5TWpJeU1q

notice that the encoded lines generated by MIME::Base64 (60 chars) are
much shorter than those generated by eudora (76 chars). (incidentally,
also notice that eudora sent a jpg as application/octet-stream. ugh.)

my assumption is that the line length is the problem. this seems to be

hard-coded into Base64.pm so i don't want to muck with it if i don't
have to. i'm sure others have been able to deliver correctly-encoded
attachments .. do you have any insight? if not, i guess i'll be fwd'ing
to comp.lang.misc.perl.

thanks - bm

------- End of forwarded message -------



Fri, 16 Jun 2000 03:00:00 GMT  
 MIME::Base64 troubles

Quote:

> i'm writing a web-based mail client. for some reason, my base64-encoded

> attachments aren't being decoded properly by other clients, although
> they are handled correctly by my client.

> as an example, i attached the same jpg to a composition in eudora and a

> composition in my client and sent both messages to a shell account so i
> could save each message as a folder with pine. interesting results.

> these are the headers for and the first few lines of the attachment, for
> each message.

> from eudora:

> --=====================_882595579==_
> Content-Type: application/octet-stream; name="Bridesmd.jpg"
> Content-Transfer-Encoding: base64
> Content-Disposition: attachment; filename="Bridesmd.jpg"

> /9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
> HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
> MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAFlAMgDASIA
> AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA

> and from my web client:

> ------------=_882566924-17652-3
> Content-Type: image/jpeg; name="Bridesmd.jpg"
> Content-Disposition: attachment; filename="Bridesmd.jpg"
> Content-Transfer-Encoding: base64

> LzlqLzRBQVFTa1pKUmdBQkFRRUJMQUVzQUFELzJ3QkRBQWdHQmdjR0JRZ0hC
> d2NKQ1FnS0RCUU5EQXNMCkRCa1NFdzhVSFJvZkhoMGFIQndnSkM0bklDSXNJ
> eHdjS0RjcExEQXhORFEwSHljNVBUZ3lQQzR6TkRMLwoyd0JEQVFrSkNRd0xE
> QmdORFJneUlSd2hNakl5TWpJeU1qSXlNakl5TWpJeU1qSXlNakl5TWpJeU1q

> notice that the encoded lines generated by MIME::Base64 (60 chars) are
> much shorter than those generated by eudora (76 chars). (incidentally,
> also notice that eudora sent a jpg as application/octet-stream. ugh.)

> my assumption is that the line length is the problem. this seems to be

> hard-coded into Base64.pm so i don't want to muck with it if i don't
> have to. i'm sure others have been able to deliver correctly-encoded
> attachments .. do you have any insight? if not, i guess i'll be fwd'ing
> to comp.lang.misc.perl.

I think you will have to show us the code the generates the attachment
above.  The MIME::Base64 module should also generate lines which are
76 characters long, but I don't think your short lines is the problem.
The encoded stuff itself should be equal in the two examples above.

--
Gisle Aas



Sat, 17 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MIME::Base64

2. MIME (base64) encoding script, help?

3. Trying to install MIME-Base64-2.06

4. MIME and Base64 Modules for Win32

5. Modules for MIME, uudecode, base64 decode?

6. Resize image in mime base64 formar

7. sv_utf8_downgrade() problems with MIME::Base64

8. Problem building MIME::BASE64 module

9. Perl Script for MIME BASE64 decode here

10. MME::QuotedPrint and MIME::Base64

11. MIME::Base64 Not Working Properly

12. sv_utf8_downgrade() problems with MIME::Base64

 

 
Powered by phpBB® Forum Software