See the code for this demo in the demo.html file of the file-input GitHub repository.
We've restricted files to those with a "jpeg" or jpg" extension. Files also must be between 500 kB and 3 MB in size.