0

I saw a lot of file up loader plugins .I dont want to use the entire file upload plugin ..

Means , I am using my own code. But i didnt find a way to restrict the file type the uploader accepts .. How can i do that? . Is there any plugin which doing only this function ( I don't want to use a full file uploader plugin)

Null Pointer
  • 9,089
  • 26
  • 73
  • 118

1 Answers1

3

This requires HTML5, jQuery is not needed. I think it will be small enough to use pure JavaScript:

These are just some ideas. You can devise some heuristic to check the file type based on this.

Bakudan
  • 19,134
  • 9
  • 53
  • 73
  • A concrete example of the use of the html "accept attribute" would have been useful for newbies like myself. Here's one i found: `` – Kevin Mar 19 '17 at 22:53