-1
<input type='file' id="uploadImg" name="image[]" accept="image/jpeg" multiple="multiple"/>

I have an input file multiple, I want to limit max-10 files. Is any way to limit user can only select 10 files when their upload window pop?

(I'm not asking about detecting and giving alert, I'm asking about limit files a user can select.)

Maybe something like <input type='file' limit='10' />?

nbanic
  • 1,270
  • 1
  • 8
  • 11
Ben
  • 2,562
  • 8
  • 37
  • 62
  • Check this [question](http://stackoverflow.com/questions/10105411/how-to-limit-maximum-items-on-a-multiple-input-input-type-file-multiple) – Andras Toth May 10 '14 at 06:45

2 Answers2

0

Try

Plugin

$(function () { // wait for document to load
    $('#MyFileUpload').MultiFile(10); //limit will be set to 10
});

http://www.fyneworks.com/jquery/multifile/

Tushar Gupta - curioustushar
  • 58,085
  • 24
  • 103
  • 107
0

You can check this with jQuery adding an onchange event that checks this.files.length in the callback

see this fiddle http://jsfiddle.net/sfarsaci/ArTD4/

Totò
  • 1,824
  • 15
  • 20