This avoids searching the same directories twice, once to count the files and then once for real.
Attach a file by drag & drop or click to upload