Wicket
  1. Wicket
  2. WICKET-4129

setting getApplicationSettings().setDefaultMaximumUploadSize() has no effect

    Details

      Description

      I am creating an Google Appspot - Wicket application and want to allow users to upload a file. This file can be upto 15MB, since Google uses a limited JRE it is not possible to create Files.

      When setting DefaultMaximumUploadSize to 15MB nothing changes, Appspot still throws a SecurityException. Wicket is not really using the DefaultMaximumUploadSize setting at all, it is passed along the multipart handling but not used. The DiskFileItemFactory is not receiving the DefaultMaximumUploadSize and sticks to a default value of 10240.

      I am unable to make a patch file at the moment, can make one later if need be. Here is the required change:

      MultipartServletWebRequestImpl.java:90 is currently:

      this(request, filterPrefix, maxSize, upload, new DiskFileItemFactory(Application.get().getResourceSettings().getFileCleaner()));

      and it should be:

      this(request, filterPrefix, maxSize, upload, new DiskFileItemFactory(maxSize, null, Application.get().getResourceSettings().getFileCleaner()));

        Activity

        Hide
        Hielke Hoeve added a comment -

        Aah I see. Sorry for the bug report.

        Show
        Hielke Hoeve added a comment - Aah I see. Sorry for the bug report.
        Sven Meier made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Sven Meier [ svenmeier ]
        Resolution Invalid [ 6 ]
        Hide
        Sven Meier added a comment -

        FileUploadBase#sizeMax and FileUploadBase#fileSizeMax are two different settings, MultipartServletWebRequestImpl configures the former only.

        You have either to hook your code into the MultipartServletWebRequestImpl creation and set #fileSizeMax yourself or we should a new setting to IApplicationSettings.

        Show
        Sven Meier added a comment - FileUploadBase#sizeMax and FileUploadBase#fileSizeMax are two different settings, MultipartServletWebRequestImpl configures the former only. You have either to hook your code into the MultipartServletWebRequestImpl creation and set #fileSizeMax yourself or we should a new setting to IApplicationSettings.
        Hielke Hoeve created issue -

          People

          • Assignee:
            Sven Meier
            Reporter:
            Hielke Hoeve
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1m
              1m
              Remaining:
              Remaining Estimate - 1m
              1m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development