The `<tc:file/>` create a textfield with a choose directory button on the right.

To load up files to the server for JSF 2.0 and 2.1 you will need to add a multipart-config entry to the FacesServlet in the `web.xml` file. Since JSF 2.2 this is not required.

Here you can configure some more general information.

<multipart-config> <max-file-size>20848820</max-file-size> <max-request-size>418018841</max-request-size> <location>/tmp</location> <file-size-threshold>1048576</file-size-threshold> </multipart-config> <tc:file label="Upload" value="\#{uploadController.file1}"/>

You can filter files using the `<tc:validateFileItem/>` tag within the `<tc:file/>`. In the following example only images and PDF files are excepted.

Define a text with `placeholder` attribute

You can upload multiple files in one selection and request. Use the `multiple="true"` attribute.

Ajax can be activated by adding `<f:ajax/>` to the `<tc:file/>` tag.

The Ajax feature of file upload works with JSF 2.2 or higher!