Corrupt attachments

Help
2011-03-17
2013-05-01
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-17

    We have had the same problem since 0.9.x versions, during the years the servers have changed, PHP versions upgraded, different webservers etc, the only common thing is we have always run on windows server.

    Currently we are running NOCC 1.8.3 in Windows 2008 R2 x64 server, PHP 5.3.5 x64, Apache 2.2.17 x64.

    Every attachment that I try open in NOCC is corrupted.  I just made a small test file, word "HELLO" in a hello.rtf file. Its 180 bytes.  Send it to myself using Outlook (same with any client), opened the message in NOCC, saved the hello.rtf to disk and it's 183 bytes!  Always 3 bytes larger than the original attachment, three unreadable characters in the beginning of the file. And of course it's unreadable after that.

    Any ideas??  This has haunted us for years, through all upgrades, fresh new installs etc.

     
  • Tim Gerundt

    Tim Gerundt - 2011-03-17

    Mhhh, I never used NOCC on a Windows Server, but I had no problems von Windows XP (x86) and Windows 7 (x64). I found a bug with Unicode "byte order mark" (BOM) in images few months ago:
    http://nocc.svn.sourceforge.net/viewvc/nocc?view=revision&revision=2291

    But this was no problems with attachments. I hopefully release NOCC 1.9 in the next few days. Maybe this time it is fixed by by some changes (or cleanup) in the source code?

    Greetings,
    Tim

     
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-17

    Ok, I'll update when the 1.9 is out and check if the problem's still there.

    To me looks like some strange encoding error at some point.  Happy to post example files if it will help tracking it down.

     
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-23

    Unfortunately still the same problem in v1.9.0.

    I created a simple hello.txt, only word "hello" in it and size 7 bytes (in hex: 68 65 6C 6C 6F OD OA)

    Emailed it to my self, opened the message in NOCC and saved the attachment to disk.

    It's 10 bytes: EF BB BF 68 65 6C 6C 6F OD OA, three bytes added to the beginning of the file.

    Any ideas, I'm out of them…?

     
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-23

    Just found out hat this corruption only happens if the selected language is finnish (default in our system, and have done some modification to the standard fi-language pack), interesting…

     
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-23

    Ok, found out that opening a language file in notepad and saving, even without changing anything, makes something go wrong.

    Tested with several languages.  If it's clean from the install pack attachment are ok.  Opening and saving example es.php (without changing anything), than reading the same message and saving the attachment, BANG there's 3 more bytes in the file!  Guess notepad is not the editor to use here…

     
  • Jukka Pakkanen

    Jukka Pakkanen - 2011-03-23

    Yeah, problem finally solved. Edited now the language files with Notepad++ editor and attachments are ok!  Looks like NOCC is somehow extra sensitive with the text format of language files and conf_lang.php file as well.  Never before have had any problems editing php, html, etc text files with windows notepad.

     
  • Tim Gerundt

    Tim Gerundt - 2011-03-26

    Good that you found the problem! The conf_lang.php file and language files  must save as UTF-8 but without BOM since PHP has problem with the BOM (byte order mark) bytes. In Notepad++ you can select this, but I don't know how the Windows Notepad works. It seems that it save the BOM, which was added as trash to the attachments.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks