2

what are the allowed mime types in file accept attribute?

<input type="file" name="fileupload" accept="application/csv,application/pdf"/>

I tried images, video, audio these all worked but csv, pdf, doc not working are these allowed in this accept attribute?

1 Answers1

0

Described on W3Schools the accept attribute can handle the following values:

<input accept="file_extension|audio/*|video/*|image/*|media_type" />

  • file_extension
    • A file extension starting with the U+002E FULL STOP character, e.g: .gif, .jpg, .png, .doc
  • audio/*
    • All sound files are accepted
  • video/*
    • All video files are accepted
  • image/*
    • All image files are accepted
  • media_type
    • A valid media type, with no parameters (A list of valid media_types is provided here).

There are all of your asked types described (e.g. .csv)

(Possible related to File input 'accept' attribute - is it useful?)

Community
  • 1
  • 1
ceekay
  • 481
  • 3
  • 13
  • 1
    this is not working. –  Mar 23 '15 at 14:35
  • what browser do you use for testing? have you tried `.csv` instead? – ceekay Mar 23 '15 at 14:41
  • sure the right version? With the media_type i also had problems like mentioned in [this answer](http://stackoverflow.com/questions/11832930/html-input-file-accept-attribute-file-type-csv) but with the file_extension it works like a charm ... – ceekay Mar 23 '15 at 15:36