Aw: Re: No fielderror for empty files with ActionFileUploadInterceptor
Ute Kaiser <[email protected]> Wed, 1 Oct 2025 17:58:42 +0000
| Newsgroups | gmane.comp.jakarta.struts.user |
|---|---|
| Message-ID | <trinity-f073aff1-792d-4f50-abd7-b036e57cc93c-1759341521906@trinity-msg-rest-webde-webde-live-7744799d68-r99pb> |
Hi Lukasz,
fine and thx !!!
But I am afraid I have to wait not familiar with github and no maven (migr=
ating from 2002 means ant :-)
Best regards
Ute
> Gesendet: Mittwoch, 1=2E Oktober 2025 um 18:14
> Von: "Lukasz Lenart" <lukaszlenart@apache=2Eorg>
> An: "Struts Users Mailing List" <user@struts=2Eapache=2Eorg>
> Betreff: Re: No fielderror for empty files with ActionFileUploadIntercep=
tor
>
> Please check the latest 6=2E8=2E0 (under vote) or 7=2E1=2E1 (test build =
is
> ready) versions as this behaviour has changed
> https://issues=2Eapache=2Eorg/jira/browse/WW-5366
>=20
> =C5=9Br=2E, 1 pa=C5=BA 2025 o 18:12 Ute Kaiser <utkai@web=2Ede=2Einvalid=
> napisa=C5=82(a):
> >
> > Hi,
> >
> > I would appreaciate a field error when I try to upload an empty file=
=2E
> >
> > I only find a server log warning
> > WARN [org=2Eapache=2Estruts2=2Einterceptor=2EActionFileUploadIntercep=
tor] (default task-2) Es konnte kein Dateiname f=C3=BCr uploadDe ermittelt =
werden=2E =C3=9Cberpr=C3=BCfen Sie ob eine g=C3=BCltige Datei =C3=BCbermitt=
elt wurde=2E
> > (German properties-Key struts=2Emessages=2Einvalid=2Efile=3DCould not =
find a Filename for {0}=2E Verify that a valid file was submitted=2E)
> >
> > ActionFileUploadInterceptor=2Eintercept runs into the if, so all nice =
errors from acceptFile are not reachable=2E
> > if (uploadedFiles =3D=3D null || uploadedFiles=2Elength =
=3D=3D 0) {
> > if (LOG=2EisWarnEnabled()) {
> > LOG=2Ewarn(getTextMessage(action, STRUTS_MESSAGES_=
INVALID_FILE_KEY, new String[]{inputName}));
> > }
> > } else {
> > for (UploadedFile uploadedFile : uploadedFiles) {
> > if (acceptFile(action, uploadedFile, uploadedFile=
=2EgetOriginalName(), uploadedFile=2EgetContentType(), inputName)) {
> > acceptedFiles=2Eadd(uploadedFile);
> > }
> > }
> > }
> >
> > It seems impossible to write a field error on my own=2E
> > (I have 3 upload options, so I can not raise an error if one of them i=
s null=2E)
> >
> > Best regards
> > Ute
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts=2Eapache=2Eorg
> > For additional commands, e-mail: user-help@struts=2Eapache=2Eorg
> >
>=20
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts=2Eapache=2Eorg
> For additional commands, e-mail: user-help@struts=2Eapache=2Eorg
>=20
>