Note

The default limit for the com.liferay.faces.util.uploadedFileMaxSize context-param is 104857600 bytes (100MB). But in order to support that limit, it may be necessary to set <Connector maxPostSize=104857600"> in tomcat/conf/server.xml since the default value is only 2097152 bytes (2MB).

alloy:inputFile

InputFile is a UIInput component that renders an <input> element with type="file". Since it extends HtmlInputFile, it supports all the features of h:inputFile and also supports multi-file uploads, instant-Ajax, preview, upload progress, and validation.

Validation Usage

Validation is accomplished by adding an alloy:validateFile child tag. The contentTypes attribute is a comma-delimited list of content types such as application/pdf,image/png. The maxFileSize attribute is a Long integer that indicates the maximum number of bytes that can be uploaded for each file.
File Name File Type File Size
No files selected


                   

Source Code

Liferay Faces Alloy 4.1.1 + Liferay Faces Bridge Implementation 5.0.0 + Showcase Common 4.0.0 + Liferay Faces Util 3.4.1 + Mojarra 2.2.20