0

I was wondering if it is possible to filter files that are shown to user when he tries to upload file. Googling didn't help, it looks like everybody is rather concerned with file type validation only. Here's a picture to give a better idea of what I mean: https://i.stack.imgur.com/4V0Zb.jpg (sorry, don't have enough rep to post picture)

There was a similar question on stack overflow, but it is for c#: Filter File extension With FileUpload

Community
  • 1
  • 1
Astart
  • 11
  • 1
  • 4

4 Answers4

0

Short answer - no. Oh it is too short for StackOverflow.

gotofritz
  • 3,341
  • 1
  • 31
  • 47
  • I assumed it wouldn't be. Just wanted to double check as I couldn't even find such a question. Thanks – Astart May 10 '12 at 11:40
0

No, but you can filter using javascript after selecting files. Read this for more information: Filter Extensions in HTML form upload

Community
  • 1
  • 1
Jeroen
  • 13,056
  • 4
  • 42
  • 63
0

You can use flash uploader or javaApplet to use filters in dialog window. With php or JS you can NOT do that.

ZigZag
  • 539
  • 1
  • 8
  • 19
0

Almost...

There is the "accept" attribute for the file input tag, which has been around since before 2012 (so, the others should have known this).

However, this is treated differently in browsers (some still give the . option, not all will restrict to these types and so on), and has only recently been coded in IE and Firefox.

SEoF
  • 1,092
  • 14
  • 26