Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
60
rated 0 times [  61] [ 1]  / answers: 1 / hits: 12515  / 11 Years ago, sat, december 7, 2013, 12:00:00

I have this file input:



<input type=file name=photo[] multiple=yes>


What I want is, when someone uploads a file/files to it, I want to alert them how many files were uploaded (altogether). Like if I upload 3 files, it will alert 3 files were uploaded. And if I add 2 more files it will alert 5 files were uploaded (adding the 2 files uploaded before).


More From » jquery

 Answers
6

Try this code:



var numFiles = $(input:file)[0].files.length;

[#49760] Friday, December 6, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
trinityr

Total Points: 49
Total Questions: 107
Total Answers: 96

Location: Mayotte
Member since Fri, Oct 1, 2021
3 Years ago
;