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?

156 of 195 people (80%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Can I specify the file type to be uploaded and to be preselected in the file select dialog?

Mar 8th, 2000 00:14
Martin Honnen,


NN2/3/4 and IE4/5 don't allow that currently.

The HTML 4 specs provide for an ACCEPT attribute to list the mime types 
the server is going to process correctly and to allow the user 
agent/browser to offer those mime types for selection
  <INPUT TYPE="file"
         ACCEPT="content-type-list"
  >
thus
  <INPUT TYPE="file"
         ACCEPT="text/html, image/gif"
  >
would specify html and gif files.
It seems however that current browsers don't support the ACCEPT 
attribute.