Uploaded image for project: 'Commons FileUpload'
  1. Commons FileUpload
  2. FILEUPLOAD-20

[fileupload] Using getSize on DistFileItem after write returns 0 size

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1 Final
    • Fix Version/s: 1.2
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Bugzilla Id:
      39160

      Description

      Steps to reproduce:

      1. Upload a large file to a DiskFileItem so it is stored on the temporary location
      2. Call getSize() to retrieve the uploaded file size
      3. Call write('newlocation') to rename/write the file to the final destination
      4. Call getSize()

      In the 4. getSize() call, 0 is returned.

      This is because the getSize() call looks for the no longer existing temporary file.

      We must either make sure that the write() method updates the current file
      location so getSize() can retrieve it from there,
      or getSize is initialized on creation of the fileitem.

      This bug is also present in the 1.2RC1

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              a.schild Andre Schild
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: