Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong (encoded) attachment file name for at least windows-1251 encoding #28

Open
GoogleCodeExporter opened this issue May 22, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Try to save attachments (like explained here) 
http://code.google.com/p/php-mime-mail-parser/ form the attached file
2. Filenames extracted by the $Parser->getAttachments() are encoded like
=?windows-1251?B?0e+z4uC6IODt8eDs4ev8IF9fxO2z7/D/7e736uBfXyAo9fPk7ubts+kg?= 
=?windows-1251?B?6uXws+Lt6Oogwi7K7vH+6ikuLkpQRw==?=

3. To convert them to real filenames I used such a trick
After the code in the example:
    $filename = $attachment->filename;
I added:
    $filenamearr = imap_mime_header_decode($filename);
    $title = '';
    foreach ($filenamearr as $element) {
        $title .= iconv($element->charset,'UTF-8',$element->text);
    }
    $filename = $title;

This saves the filenames as expected.


What version of the product are you using? 
MimeMailParser.class.php    11.6 KB r21 Oct 22, 2010    eugene.emmett.wood
attachment.class.php    2.9 KB  r17 Aug 12, 2010    bucabay
Please provide any additional information below.

On what operating system?
Opensuse 12.1 (Linux)

Original issue reported on code.google.com by [email protected] on 25 Jan 2012 at 5:55

Attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant