Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-3830

uploaded files with long names get extra characters when downloaded

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      CRM_Utils_File::makeFileName() implicitly truncates filenames to 63 chars + the extension. Since the filename includes a 32 char hash any file with an original name longer than 31 chars has the hash truncated. It is then not properly removed upon download and thus there are extra alphanumeric chars from the partial hash. The maximum length of a filename for all modern filesystems is 255 chars. This patch truncates at 240 instead of 63 to give a bit of room for the extension.

        Attachments

          Activity

            People

            • Assignee:
              amit Amiteshwar Prasad
              Reporter:
              dalin dave hansen-lange
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: