Hello Geeta,
In this case you can check for the file extension once the user uploads the file and validate the same using the
Java File API
You can also add a "file type" to the dialog box that opens up when you click to upload a file, i.e. using <input type="file">, i hope you are using this.
You can use the accept keyword of the <input> tag of HTML
try this : <input type="file" accept=".csv"/>
But this will only add a specific file type to the dialog box and won't restrict the entry to a single type.
hope this helps.