faqts : Computers : Programming : Languages : JavaScript : Forms : File Upload

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

102 of 159 people (64%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

Can I filter the file type in a file upload element?

Aug 21st, 2000 09:04
Martin Honnen, lakshmi lakshmi,


HTML 4 provides the ACCEPT attribute for that, i.e.
  <INPUT TYPE="file" ACCEPT="list of mime types">
should let the browser only offer files of the specified mime types for 
selection e.g.
  <INPUT TYPE="file" ACCEPT="text/html">
should only allow selection of .htm/.html files.
It seems however that no current browser (NN4, NN6, IE4/5) supports 
that.