Saumyaraj
Saumyaraj

Reputation: 1250

Uploading a file with in html with filetype constraint

I want a user to upload .csv file using file browse of html. I have used file input type but the user can upload any type of files with that. What i want is a user can only browse and see .csv file. How can i do that?? I have read about accept parameter but it is for audio/video/images. How can i do it with .csv?

Upload new Question Bank(.csv):-<input type="file" name="file">

Upvotes: 1

Views: 1123

Answers (1)

phihag
phihag

Reputation: 287735

Use the accept attribute:

Upload new Question Bank(.csv):-<input type="file" name="file" accept=".csv" >

Upvotes: 1

Related Questions