6

This is my upload input and no matter what I try it refuses the display Powerpoint PPS files.

It displays PDF, PPT, PPTX, PPSX but not PPS

    <input type="file"
    accept="application/pdf,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.slideshow,application/vnd.openxmlformats-officedocument.presentationml.presentation"
 name="upldInput"/>

The behavior is same in all the browsers, no one shows PPS files.

Stéphane Bruckert
  • 18,252
  • 10
  • 81
  • 113
user1615362
  • 3,179
  • 7
  • 24
  • 43

2 Answers2

3

I can't find a MIME type that works. However, the following does work:

<input type="file" accept="application/pdf,.pps" name="upldInput"/>

Apparently you can mix and match file extensions and MIME types. On Chrome 25 and IE 10 (PC) this gives the desired behavior, i.e. only the matched MIME type(s) or extensions are shown.

Demo: http://jsfiddle.net/GGFVv/

I've also tried mixing multiple extensions and multiple MIME types, which also seems to work.

<input type="file" 
    accept=".pps,
    .jpg,
    .txt,
    application/pdf,
    application/vnd.ms-powerpoint,
    application/vnd.openxmlformats-officedocument.presentationml.slideshow,
    application/vnd.openxmlformats-officedocument.presentationml.presentation" name="upldInput"/>

Demo: http://jsfiddle.net/GGFVv/2/

I should note that file extension filtering does not seem to work in Firefox 19. I imagine this is because of the differences between the behavior defined by the W3C and the WHATWG.

The original mention of accept (in 1995!) is somewhat vague:

Allow an ACCEPT attribute for INPUT tag, which is a list of media types or type patterns allowed for the input.

Firefox appears to default to "all files" when it finds a value it doesn't recognize, so this is somewhat user-friendly (though not ideal).

Community
  • 1
  • 1
Tim Medora
  • 51,363
  • 11
  • 111
  • 149
2

Edit: did you try to simply add: accept=".pps"?

<input type="file"
   accept="application/pdf,
      application/vnd.ms-powerpoint,
      application/vnd.openxmlformats-officedocument.presentationml.slideshow,
      application/vnd.openxmlformats-officedocument.presentationml.presentation,
      .pps"
   name="upldInput"/>
Stéphane Bruckert
  • 18,252
  • 10
  • 81
  • 113