Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-2958

Attachments are being recorded as the wrong size when handled by the AbstractMessageHandler

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Medium
    • 2.6 Pro
    • 2.5.2 Professional
    • None
    • Server: Weblogic 8.1 sp1, RHAS 2.1, Jrockit. Client: IE 6sp2 WinXP

    Description

      When a task is created by using the POP Service (or any service that uses the AbstractMessageHandler.createAttachmentWithPart method) the file size is incorrectly stored in the database.

      When the file is later retrieved through the web interface, the download appears to hang.

      I rolled up my sleeves and discovered a few things. One the size of the file on disk, does not match the size recorded in the database. This is probably due to line 125 in AbstractMessageHandler.

      fields.put("filesize", new Long(part.getSize()));

      it's calling getSize on the Mime attachment and not the File that is just returned from the earlier line:

      File file = getFileFromPart(part, issue);

      A fix should probably read as:

      fields.put("filesize", new Long(file.length()));

      I hope to see a fix soon, so I can explain to my users that their files are there.

      Thanks,
      Noah

      Attachments

        Activity

          People

            Unassigned Unassigned
            noahcampbell Noah Campbell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: