Results 1 to 9 of 9

Thread: Attachments return garbage

  1. #1
    jackofall is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default Attachments return garbage

    My environment: Linux 2.6.9 Fedora Core 7; PHP 5.2.6; MYSQL 5.0; APACHE 2.2; SUGARCRM 5.2.0.b

    We recently started adding attachments to notes and have encountered a problem. This is the first time we have used attachments so I do not know if the problem is new or since installation (Feb. 2009).

    The problem:
    We can upload attachments just fine. When we download an attachment, the result depends on the filetype.
    .csv & .txt - Are fine
    .doc & .xls - Are garbage
    I have not tried any other filetypes to date.

    I located the uploaded documents on the server and ftp'ed one of the problematic documents back to my pc.
    I was then able to open the document just fine.

    Does anyone have any idea of what is going on?

    Thanks much.

  2. #2
    sugarcane is offline Sugar Community Member
    Join Date
    Apr 2005
    Location
    Chicago, IL
    Posts
    1,207

    Default Re: Attachments return garbage

    do the 'bad' attachments open or are you getting an error message? How big are the files you are trying to upload? Is is a .doc file or a .docx (.xls or .xlsx)?
    Intelestream has a great deal of experience hosting and customizing the SugarCRM application. Our company is made up by former employees of SugarCRM, and together we have over 50 years of experience working with the application. To learn more about us, please visit our website at www.intelestream.net or contact us directly at 800-391-4055 or by email at info@intelestream.net

  3. #3
    jackofall is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default Re: Attachments return garbage

    They are straight .doc and .xls and small in size (one page with no graphics).
    I am able to open the attachments. The .xls content consists of some garbage and then the data all dumped into the first cell. With the .doc, MS Word sayes it cannot import the specific format.

    I did the following test. I saved the .xls and .doc attachments to disk. I then compared them to the .xls and .doc files that I had ftp'ed back to my pc(see original post). I used a text editor that allows me to examine a file in hex. The saved attachments each had a 2byte code added to the beginning of the file, otherwise they looked identical.

    Hopefully this will mean something to you or someone else. All assistance is greatly appreciated.

  4. #4
    jackofall is offline Junior Member
    Join Date
    Jun 2009
    Posts
    3

    Default More Information

    Please check the attachment and reference below.

    Quick rehash of my test. I saved an attached ms word.doc document to my pc. ("DOC - A" - Top part of picture).

    I then located the attached document in the sugar cache/uploads folder and transferred it to my pc via ftp ("DOC-B" - bottom of picture).

    MS Word was unable to open DOC-A but opened DOC-B okay.

    Note in the picture that the first 3 bytes of DOC-A (EF BB BF) appear to be the only difference between DOC-A & DOC-B.

    I used the hex editor to delete the first 3 bytes of DOC-A and saved the results.

    MS-Word then opened the document Okay.

    So what are those 3 bytes and why are they there?

    Thanks again for any help.

    Bill
    Attached Images Attached Images  

  5. #5
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Attachments return garbage

    The EFBBEF is a so called ByteOrderMark to define the file as a UTF-8 file.
    Perhaps you do not have mbstring activated in php.ini.
    In this case apache/php decides how files are stored.
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  6. #6
    dinudanial is offline Sugar Community Member
    Join Date
    Jun 2007
    Posts
    108

    Default Re: Attachments return garbage

    Me too have the same issue.
    When i upload a doc file and when i download it, its not at all accessible for open.
    mbstring is active in my server.

    Can anyone have a solution

    Thanks in advance

  7. #7
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Attachments return garbage

    Did anyone solve the problem?
    Is it possible that a
    default_charset = "UTF-8"
    in php.ini can solve this issue?
    Harald Kuske
    Pre-Sales Engineer Central Europe

    SUGARCRM Deutschland GmbH
    Erika-Mann-Str. 53, 80636 Munich, Germany
    Email: hkuske@sugarcrm.com
    Home: http://www.sugarcrm.com


  8. #8
    freedbill is offline Member
    Join Date
    Feb 2009
    Posts
    10

    Default Re: Attachments return garbage

    Thanks for checking back.
    No I have not resolved this issue.
    I did find another post with the same issue:
    http://www.sugarcrm.com/forums/showt...263#post212263

    I have a little more info to pass along:
    I tried changing the default_charset and still had a problem.
    I have two independent installations of Sugar for two clients running on the same server. One is on version 5.2 the other on 5.5

    Both installations have the problem.

    I can add that .pdfs download just fine.
    I can also add that .gif, .png, & .jpg do not download correctly.

    So there you have it

    Thanks to all who have followed this post. If anyone has any suggestions or can add information to this problem, it would be greatly appreciated.

  9. #9
    CP_ITC is offline Junior Member
    Join Date
    Jul 2011
    Posts
    1

    Default Re: Attachments return garbage

    Hello All,

    I experienced this same issue when moving a SugarCRM install from a Windows 2k3 server to a 2k8 server. I set default_charset = UTF-8 in php.ini (notice no quotes). I restarted IIS and was then able to successfully download the DOC files from SugarCRM.

    Cheers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Garbage on top of CRM screen
    By mobility in forum Help
    Replies: 4
    Last Post: 2008-01-24, 07:52 AM
  2. Garbage email
    By chinwoei in forum Help
    Replies: 0
    Last Post: 2007-08-22, 08:14 AM
  3. Garbage in subject line and from address
    By andydreisch in forum Help
    Replies: 0
    Last Post: 2006-05-19, 04:35 PM
  4. Garbage at the top of the page
    By eryde in forum Help
    Replies: 4
    Last Post: 2005-07-10, 08:52 PM
  5. Replies: 12
    Last Post: 2004-11-02, 01:42 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •