Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Kush Sahu
How to validate file to be uploaded?
7 febbraio 2013 2.58
Risposta

Kush Sahu

Punteggio: Junior Member

Messaggi: 25

Data di Iscrizione: 7 agosto 2012

Messaggi recenti

I am working on liferay project. I have to put file upload functionality. For which I have used

<bridge:inputFile/>

But my upload method is not called when I try to upload a blank file of 0 bytes. Actually my validation for blank file is inside my upload method.
Neil Griffin
RE: How to validate file to be uploaded?
25 febbraio 2013 9.59
Risposta

Neil Griffin

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 2179

Data di Iscrizione: 26 luglio 2005

Messaggi recenti

I tried this with the jsf2-portlet demo the other day, and uploading a zero-byte file will cause the jsf2-portlet to catch the error and display an error message to the user.

So I would recommend that you look at the ApplicantBackingBean.handleFileUpload(FileUploadEvent) method and also there is a class in the bridge called RequestParameterMapMultiPartImpl.java that might be where the error message gets caught.