php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26742 The base64_encode() function returns an string that cannot decoded by outlook
Submitted: 2003-12-29 09:32 UTC Modified: 2004-01-06 20:51 UTC
Votes:4
Avg. Score:4.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: eric dot maman at free dot fr Assigned:
Status: No Feedback Package: *URL Functions
PHP Version: 4.3.4 OS: Windows 2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2003-12-29 09:32 UTC] eric dot maman at free dot fr
Description:
------------
I am using the base64_encode() function to send attachements by email.
When I receive the mail on Outlook, the attachement is visible but corrupeted.
I have tested the whole process and my conclusion is that the base64_encode() function does not work correctly.
I have made a workarround with an extrenal program that performs the base64 encoding and it work correctly.


Reproduce code:
---------------
    function EncodeString ($str, $encoding = "base64") {
        $encoded = "";
        switch(strtolower($encoding)) {
          case "base64":
              $encoded = chunk_split(base64_encode($str), 76, $this->LE);
              break;
          case "7bit":
          case "8bit":
              $encoded = $this->FixEOL($str);
              if (substr($encoded, -(strlen($this->LE))) != $this->LE)
                $encoded .= $this->LE;
              break;
          case "binary":
              $encoded = $str;
              break;
          case "quoted-printable":
              $encoded = $this->EncodeQP($str);
              break;
          default:
              $this->SetError($this->Lang("encoding") . $encoding);
              break;
        }
        return $encoded;
    }



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-29 10:35 UTC] iliaa@php.net
What is the value of $this->LE ? 
 [2004-01-06 20:51 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2004-01-22 14:48 UTC] luis dot cervantes at uspeurope dot com
Hi.
I have the same problem with function. 
Can you tell me how you resolved the problem.
Its is possible that the problem is the instalation of php.
mimetypes, etc.
Thanks for all.

Luis
 [2004-03-10 08:49 UTC] louloufox29 at hotmail dot com
I have the same problem (using PHP 4.3.3 with Easy PHP on a win XP server)

When i send the attachment using Outlook, the part of message source about attachement is different. The string is not the same... (that's why it seems sorrupted). 

I've try to encode a file and then decode the same file, save it using a different name and  can't open it, it is the same probleme.
So i think it's realy a PHP Bogus (i can't believe in the config way of resolution...)

Regards !
 [2004-03-10 08:53 UTC] louloufox29 at hotmail dot com
Just for information, the problem exist with or without using the function send by eric. In my case, it wasn't a workaround.
Regards.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC