Struts 2
  1. Struts 2
  2. WW-3562

FileUploadInterceptor: File not uploaded when file is empty (0 bytes)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.1.1
    • Fix Version/s: 2.3.1
    • Component/s: Core Interceptors
    • Labels:
      None
    • Environment:

      Windows 7 64-bit or Windows XP with either Tomcat or Jetty Web Container

      Description

      When a user uploads a file that is emtpy (0 bytes), the actual file is not copied to the web container's "work" directory. All other information about the file is copied though (e.g. contentType, fileName). Although the file is emtpy file.exist() should still equal "true". I have attached a demo app that demostrates the issue. IMO, an empty file should be treated just like a non-empty file.

        Activity

        Burton Rhodes created issue -
        Burton Rhodes made changes -
        Field Original Value New Value
        Attachment StrutsUploadTest.zip [ 12468809 ]
        Burton Rhodes made changes -
        Description When a user uploads a file that is emtpy (0 bytes), the actual file is not copied to the web container's "work" directory. All other information about the file is copied thought (e.g. contentType, fileName). Although the file is emtpy file.exisit() should still equal "true". I have attached a demo app that demostrates the issue. IMO, an empty file should be treated just like a non-empty file. When a user uploads a file that is emtpy (0 bytes), the actual file is not copied to the web container's "work" directory. All other information about the file is copied thought (e.g. contentType, fileName). Although the file is emtpy file.exist() should still equal "true". I have attached a demo app that demostrates the issue. IMO, an empty file should be treated just like a non-empty file.
        Burton Rhodes made changes -
        Description When a user uploads a file that is emtpy (0 bytes), the actual file is not copied to the web container's "work" directory. All other information about the file is copied thought (e.g. contentType, fileName). Although the file is emtpy file.exist() should still equal "true". I have attached a demo app that demostrates the issue. IMO, an empty file should be treated just like a non-empty file. When a user uploads a file that is emtpy (0 bytes), the actual file is not copied to the web container's "work" directory. All other information about the file is copied though (e.g. contentType, fileName). Although the file is emtpy file.exist() should still equal "true". I have attached a demo app that demostrates the issue. IMO, an empty file should be treated just like a non-empty file.
        Maurizio Cucchiara made changes -
        Assignee Maurizio Cucchiara [ maurizio.cucchiara ]
        Maurizio Cucchiara made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.3 [ 12315916 ]
        Resolution Fixed [ 1 ]
        Lukasz Lenart made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Maurizio Cucchiara
            Reporter:
            Burton Rhodes
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 24h
              24h
              Remaining:
              Remaining Estimate - 24h
              24h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development