Re: 7.1.1 upload with zero file size

Greg Huber <[email protected]> Fri, 10 Oct 2025 10:18:15 +0100
Newsgroups gmane.comp.jakarta.struts.devel
Message-ID <[email protected]>
I will see if I can create a test to replicate the two messages, but my 
initial attempt was not successful, something else to hunt down.🙁

Don't think its a release blocker, rather an annoyance.

Cheers

On 09/10/2025 15:31, Lukasz Lenart wrote:
> There is no change in error flow, the parser just reports an error and
> returns. And maybe that's the issue, and your custom field isn't
> parsed at this point - the only option I see is to let the parser
> finish and then return the final result instead of breaking in the
> middle.
>
>
> Cheers
> Ɓukasz
>
> ƛr., 8 paĆș 2025 o 11:07 Greg Huber<[email protected]> napisaƂ(a):
>> I managed to trace the source of the duplicate message.  Basically, the
>> new error message shortcuts to calling "input" on my action.
>>
>> .....I have a hidden field to check to make sure the upload is from my
>> form, and then I have an interceptor that checks the value and if
>> invalid calls input on my action, to show an error message.
>>
>> <s:form id="uploadFiles" action="myUpload" method="POST"
>> enctype="multipart/form-data">
>>           <s:hidden name="ckeckme" />
>>
>> <s:form
>>
>> The interceptor (extends MethodFilterInterceptor) adds an error:
>>
>> theAction.addError("error.permissions.deniedCheck");
>>
>> and then returns "input"
>>
>> The input is a chain in my case  (as I use list as the screen default,
>> tiles).  If I change the input to tiles I get one message.
>>
>> <action name="myUpload!*" method="{1}" class="my.Upload">
>>
>>               <!-- input for security check -->
>>               <result name="input" type="chain">myUpload</result>
>>               <result name="list" type="tiles">.MyUpload</result>
>>
>> </action>
>>
>> These seems to be some difference in the error flow, as the max file
>> size logic calls my execute, whilst the zero file size check shortcuts
>> to input, and then gets picked up by the workflow and adds the extra
>> message.  For me.
>>
>> I will experiment with changing my input to tiles and see what happens.
>>
>> On 04/10/2025 09:54, Lukasz Lenart wrote:
>>> I tested the empty file upload behaviour using the example app
>>> https://github.com/apache/struts-examples/tree/main/file-upload
>>> It uses single <s:actionerror/> tag and based on struts-default
>>> package, and I get single error message:
>>>
>>>> File zero.txt for field upload is empty (0 bytes). Empty file uploads are not allowed.
>>> I assume you have used a custom interceptor stack (as you have
>>> mentioned early) and that was the cause.
>>>
>>>
>>> Cheers
>>> Ɓukasz
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe,e-mail:[email protected]
>>> For additional commands,e-mail:[email protected]
>>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:[email protected]
> For additional commands, e-mail:[email protected]
>