Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get count of selected files in dropzone

What I m trying to do is get a count of selected files in dropzone before upload them.

var count= myDropzoneNST.getAcceptedFiles().length;

I can get a count of uploaded files using this line, but What I m trying to do is to get count of selected valid files before upload them.

like image 847
Dumindu Madushanka Avatar asked Apr 28 '15 04:04

Dumindu Madushanka


1 Answers

My experience is that the .get*Files() methods are not very accurate. The .getAcceptedFiles().length usage will return the current number of accepted files minus the one just having been added, if you call it from the addedFile() event handler, for example. This may be "as designed", but it makes the wording of "addedFile()" somewhat odd.

like image 182
joho Avatar answered Sep 17 '22 02:09

joho