Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Input file accept only text/vtt mime types

I am trying to make input file accept webvtt subtitles, however if I do this:

<input type="file" name="sub_upload" accept="text/vtt">

It still shows other files along vtt extension in file browse window. Is there a way to filer files with only vtt extension?

like image 802
Toniq Avatar asked Nov 15 '25 15:11

Toniq


1 Answers

pretty late to answer this i know but this worked for me , hope it benefits someone

<input type="file" name="sub_upload" accept=".vtt"> // for showing only .vtt files

<input type="file" name="sub_upload" accept=".vtt,pdf,.srt"> //generally for showing only .vtt , .pdf,.srt files
like image 119
Ahmed Maher Avatar answered Nov 18 '25 16:11

Ahmed Maher



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!