# JSF 2.2 File Upload Samples

This sample demonstrates the use of a simple file upload component introduced in JSF 2.2.
One option demonstrates a traditional file upload operation, while the other option
demonstrates a file upload operation over Ajax.
For both options, Click on the "Browse" button and navigate to the
javaee7/jsf/fileupload directory. choose one of inputFileFailure.txt or
inputFileSuccess.txt . Then press the Upload button. There is a validator attached to the file input component that examines the contents of the uploaded file,
looking for the string JSR-344. The inputFileFailure.txt file does not contain
the string so you should see a validation error: Invalid file. File must contain special string
The inputFileSuccess.txt file contains the JSR-344 string so you should see a success message:
This file contains the string JSR-344 and will be successfully set into the model.