Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1325

Servlet MultipartConfig attribute file-size-threshold not working

XMLWordPrintable

    • Hide

      I used JBoss Developer Studio, but any IDE can be used to stop the application to check if the file is being written on disk or not

      • Open the IDE;
      • Import the maven project attached (undertowupload);
      • Update the location path in web.xml with a valid path for you;
      • Put a breakpoint on 'read()' method of UploadImageBean class;
      • Deploy the application on EAP running in debug mode inside the IDE;
      • Access the page using http://localhost:8080/undertowupload-1.0;
      • Upload any file with less than 10mb;
      • After the debugger being triggered, check the location defined on web.xml if the file was created;
      Show
      I used JBoss Developer Studio, but any IDE can be used to stop the application to check if the file is being written on disk or not Open the IDE; Import the maven project attached (undertowupload); Update the location path in web.xml with a valid path for you; Put a breakpoint on 'read()' method of UploadImageBean class; Deploy the application on EAP running in debug mode inside the IDE; Access the page using http://localhost:8080/undertowupload-1.0 ; Upload any file with less than 10mb; After the debugger being triggered, check the location defined on web.xml if the file was created;

      It's not working the file-size-threshold attribute from MultipartConfig in Servlet 3 to not write the uploaded file on disk until it reaches that size.

      It writes on disk even with the file size being lower than the threshold. This should not be happening as the documentation says:

              spyrkob Bartosz Spyrko-Smietanko
              spyrkob Bartosz Spyrko-Smietanko
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: