Re: Fileupload on JakartaEE

2022-12-30 Thread Greg Huber
Seems there is more going on, as without it there are two extra parts with no StoreLocation. name=, StoreLocation=null, size=0 bytes, isFormField=false, FieldName=uploadedFiles name=myimage.jpg, StoreLocation=/home/dev/git/myapp/myapp/work/upload_0f8323e4_9dd9_4972_8305_6b7c31911f47_0033

Re: Fileupload on JakartaEE

2022-12-30 Thread Lukasz Lenart
I have made this new MultiPartParser optional for now and stick to the Commons Fileupload for now. I will document how to use the new Servlet API 3.1 based parser and it will be default98 since Struts 7.0.0 Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ ---

Re: Fileupload on JakartaEE

2022-12-30 Thread Lukasz Lenart
pt., 30 gru 2022 o 10:06 Greg Huber napisał(a): > > Also need an extra check || "".equals(part.getSubmittedFileName() > > for (Part part : parts) { > if (part.getSubmittedFileName() == null || > "".equals(part.getSubmittedFileName()) ) { // normal field Empty getSubmittedFileName() m

Re: Fileupload on JakartaEE

2022-12-30 Thread Greg Huber
Also need an extra check || "".equals(part.getSubmittedFileName() for (Part part : parts) {     if (part.getSubmittedFileName() == null || "".equals(part.getSubmittedFileName()) ) { // normal field    LOG.error("Ignoring a normal form field: {}", part.getName());  

Re: Fileupload on JakartaEE

2022-12-30 Thread Lukasz Lenart
pt., 30 gru 2022 o 09:39 Greg Huber napisał(a): > Is it possible to use the original temp file that tomcat creates rather > than creating another one? If "struts.multipart.saveDir" is not provided (or empty), Struts will use "javax.servlet.context.tempdir" which should be defined in servlet conte

Re: Fileupload on JakartaEE

2022-12-30 Thread Greg Huber
With the correct servlet mapping (other email) it kind of works, but the file has zero size. in ServletMultiPartRequest.extractFile(Part part, String saveDir) it creates an empty temporary file (line 134) which it returns: File tempFile = File.createTempFile(prefix + "_", suffix, new File(sav

Re: Fileupload on JakartaEE

2022-12-30 Thread Lukasz Lenart
czw., 29 gru 2022 o 17:40 Greg Huber napisał(a): > Does not seem to call the servlet, only a 404. I use the > StrutsPrepareAndExecuteFilter. With the filter mapping, how does it use the > servlet mapping? The basic idea is that when the filter detects if this a fileupload request and the new