Page 1 of 2 12 LastLast
Results 1 to 10 of 13
Like Tree1Likes

Thread: Problem with notes and file attachments

  1. #1
    jukuo Guest

    Default Problem with notes and file attachments

    Hello!

    When I try to download attached file (only in notes section) the filename has changed to index.php. For example view shows xxx.docx but when I try to download, it will change to index.php!
    If I open the index.php with word, it will open the correct xxx.docx file.

    How to change the filename to correct one?

    Sorry about bad english

    -Juho

  2. #2
    andopes's Avatar
    andopes is offline A Sugar Hero | Help Forum Moderator
    Join Date
    Jul 2006
    Location
    São Paulo - Brazil
    Posts
    8,491

    Default Re: Problem with notes and file attachments

    Definitely this is not the regular SugarCRM behavior.
    What is the version of your current SugarCRM installation?
    Did you install any package (which ones) or customize code by hand?
    Did you upgrade your instance from some older one?

    Cheers
    André Lopes
    DevToolKit / Project of the Month - June 2009
    Lampada Global Services- Open Source Solutions
    Avenida Ipiranga, 318
    Bloco B - CJ 1602
    São Paulo, SP 01046-010
    Brazil
    Office: +55 11 3237-3110
    Mobile: +55 11 7636-5859
    e-mail: andre@lampadaglobal.com

    Lampada Global delivers offshore software development and support services to customers around the world.
    Lampada is proud to be a SugarCRM Gold Partner, revolutionizing Customer Relationship Management.

    I DO NOT answer questions through PM and Email. If you need some help post your question into SugarForum.

  3. #3
    nasuk is offline Junior Member
    Join Date
    Aug 2006
    Location
    Wallingford, Oxon, UK
    Posts
    1

    Default Re: Problem with notes and file attachments

    Hi,

    I'm having the same problem. All was working well, but I upgraded from 6.5.5 to 6.5.9 this morning. Now when I download an attachment (labelled correctly as a PDF), it downloads the correct file, but has named it index.php (and therefore the browser doesn't know how to open it so just downads it).

    If I open the index.php file in a text editor I see the "PDF-1.4" in the header, and if I rename the index.php file to index.pdf it will open correctly. I've checked with an xlsx file also and same result.

    If I open it using the iPad it actually opens the file but names it index.php - I guess the iPad examines the content of the file to determine its type rather than the extension.

    Thanks and best regards

    Dominic Watts
    SugarCRM CE 6.5.9 -- Ubuntu Linux Server 10.4.3
    Apache 2.2.14 -- PHP 5.3.2 -- MySQL 5.1.66

  4. #4
    domwatts Guest

    Default Re: Problem with notes and file attachments

    Hi,

    I'm having the same problem. .All was working well, but I upgraded from 6.5.5 to 6.5.9 yesterday morning. .Now when I download an attachment in Notes (file name shown correctly a "Filename.pdf"), it downloads the correct file/data, but has named it index.php (and therefore the browser doesn't know how to open it, and instead just downloads it). .

    If I open the index.php file in a text editor I see the "PDF-1.4" in the header, and if I rename the index.php file to index.pdf it will open correctly. .I've checked with an xlsx file also and same result. I have also uploaded a new file and tried downloading it - same result.

    Same problem on both IE9 and Chrome, though if I open it using the iPad it actually opens the file correctly but names it index.php in the safari tab title - I guess the iPad examines the content of the file to determine its type rather than the extension.

    On my test instance I rolled this back to 6.5.5, and then upgraded in steps, and the code 'broke' between 6.5.7 and 6.5.9

    Thanks and best regards,

    [apologies if a double post, but don't think previous post as nasuk made it to the moderators due to vbulletin account issue]

    Dominic Watts
    SugarCRM CE 6.5.9 . -- . Ubuntu Linux Server 10.4.3
    Apache 2.2.14 . -- . .PHP 5.3.2 . -- . .MySQL 5.1.66

  5. #5
    cbrown2375 is offline Junior Member
    Join Date
    Jan 2012
    Posts
    4

    Default Re: Problem with notes and file attachments

    Hello,
    You guys are not the only ones. I am running into this issue now as well. I basically did the same as domwatts. I upgraded from a previous release to 6.5.9 and now we have the issue of attachments coming up with the name of index.php when users try to view/download the file.

  6. #6
    bizna is offline Sugar Community Member
    Join Date
    Jul 2007
    Posts
    27

    Angry Re: Problem with notes and file attachments [downloading as index.php]

    Validated here as well, after upgrading to CE 6.5.9. It worked good before that.

    It is actually the downloading part that is not working well.

    I tried all sorts of 'repairs' from the admin page, with no actual change.

    There is a reported bug, that is supposed to be fixed in 6.6.2:
    http://www.sugarcrm.com/support/bugs...ch#issue_59963

    Is there any way to fix it before the Sugar team attend to what they destroyed during the last update?

  7. #7
    danilaz is offline Junior Member
    Join Date
    Jul 2008
    Location
    Madrid, Spain
    Posts
    2

    Default Re: Problem with notes and file attachments

    Indeed, there is a bug in 6.5.9 in the file wich manages the download entry point, download.php. You can edit that file as a workaround until new SugarCRM version fixes this problem. You only have to replace notes with Notes in line 135:

    135 } elseif($file_type == 'notes') {

    135 } elseif($file_type == 'Notes') {

    Hope this helps!

  8. #8
    daniloaz Guest

    Default Re: Problem with notes and file attachments

    Indeed, there is a bug in 6.5.9 in the file wich manages the download entry point, download.php. You can edit that file as a workaround until new SugarCRM version fixes this problem. You only have to replace notes with Notes in line 135:

    135 } elseif($file_type == 'notes') {

    135 } elseif($file_type == 'Notes') {

    Hope this helps!

  9. #9
    domwatts Guest

    Default Re: Problem with notes and file attachments

    Thanks daniloaz/danilaz,

    This certainly worked for me and should keep me going until it is properly fixed.

    I also noted that the following code in download.php changed between 6.5.5 and 6.5.9,

    6.5.5
    header("Content-Disposition: attachment; filename=\"".$name."\";");

    6.5.9
    if (!$check_image) {
    header("Content-Disposition: attachment; filename=\"".$name."\";");
    }


    and if I just stop this being an if clause and run the header() regardless as per 6.5.5 it also makes the problem "go away". I guess the issue is to do with whatever $check_image is used for, so I have no idea what I might have broken.

    I would love to know what the official fix in 6.2.2 is as I would much rather patch my instance properly - but hey ......

    Thanks again,

    Dominic Watts
    SugarCRM CE 6.5.9 . -- . Ubuntu Linux Server 10.4.3
    Apache 2.2.14 . -- . .PHP 5.3.2 . -- . .MySQL 5.1.66

  10. #10
    jmertic's Avatar
    jmertic is offline Sugar Community Manager
    Join Date
    Dec 2007
    Posts
    3,996

    Default Re: Problem with notes and file attachments

    This will be fixed in 6.5.10 next week. In the meantime, here's the fix...

    Code:
    diff --git a/sugarcrm/download.php b/sugarcrm/download.php
    index c9988ef..927d036 100644
    --- a/sugarcrm/download.php
    +++ b/sugarcrm/download.php
    @@ -191,10 +191,8 @@
                 {
                     header("Content-type: application/octet-stream");
                 }
    -
    -            if (!$check_image) {
    -                header("Content-Disposition: attachment; filename=\"".$name."\";");
    -            }
    +               header("Content-Disposition: attachment; filename=\"".$name."\";");
    +            
     		}
     		// disable content type sniffing in MSIE
     		header("X-Content-Type-Options: nosniff");
    bizna likes this.
    John Mertic
    Sugar Community Manager

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Notes and Attachments
    By Linnane in forum Help
    Replies: 4
    Last Post: 2010-03-25, 06:34 PM
  2. Notes and Attachments (Invalid File Reference)
    By danrweki in forum Developer Help
    Replies: 2
    Last Post: 2008-09-06, 12:12 PM
  3. Notes with attachments
    By oxcart in forum Help
    Replies: 5
    Last Post: 2008-03-19, 11:12 PM
  4. Removing attachments from Notes/ Mulitple attachments
    By malcolmh in forum Feature Requests
    Replies: 4
    Last Post: 2006-09-15, 08:25 PM
  5. cant open attachments in notes
    By sbernd in forum Help
    Replies: 4
    Last Post: 2005-03-22, 12:38 PM

Tags for this Thread

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
  •