Archived from the Transloadit support forum. Originally posted on February 25, 2011; details may be outdated, see our docs for current behavior. Original thread
Is it possible to get the number of files in the transLoaditStart callback?
Archived from the Transloadit support forum. Originally posted on February 25, 2011; details may be outdated, see our docs for current behavior. Original thread
Is it possible to get the number of files in the transLoaditStart callback?
No. Our backend doesn’t have a clue how many files it will receive, it just sees a stream of data.
However, you can get this info in JS. I think it works like this:
var files = $('input[type=file]:first')[0].files;
console.log(files.length);
This will tell you how many files are selected by the first input element in your form.