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

          [CRM-3830] uploaded files with long names get extra characters when downloaded
          Sunil Pawar added a comment -

          Verified in r18871.

          Kurund Jalmi added a comment -

          Batch move to verification

          Amiteshwar Prasad added a comment -

          Verified with r23536

            People

            • Assignee:
              Amiteshwar Prasad
              Reporter:
              dave hansen-lange

              Dates

              • Created:
                Updated:
                Resolved: