tyme-dev commented on code in PR #778:
URL: https://github.com/apache/struts/pull/778#discussion_r1400086935


##########
core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java:
##########
@@ -186,13 +191,14 @@ protected ServletFileUpload 
createServletFileUpload(DiskFileItemFactory fac) {
     }
 
     protected DiskFileItemFactory createDiskFileItemFactory(String saveDir) {
-        DiskFileItemFactory fac = new DiskFileItemFactory();
+        DiskFileItemFactory.Builder fac = DiskFileItemFactory.builder();
         // Make sure that the data is written to file, even if the file is 
empty.
-        fac.setSizeThreshold(-1);
+        //setting 0 or -1 no longer seems to work for fileupload buffer size, 
so using 1 instead.
+        fac.setBufferSize(1);
         if (saveDir != null) {
-            fac.setRepository(new File(saveDir));
+            fac.setPath(saveDir);

Review Comment:
   @jdyer1 so the test is failing here. 
   
   i did make a mistake, this should be` fac.setPath(new File(saveDir))` i 
believe. But even when doing that, you're still not able to get the path back 
at all. 
   
   This seems like a bug with the M1 release of fileupload2, I'm never able to 
get a path back for files made with the DiskFileItemFactory, but i could be 
overlooking something too. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to