Hello everybody i need some help. I have to use javascript to count the number of files in a directory and have that value in a variable. Does anyone knows how to do that.
Thanks in advance.
If you have your directory in a variable like "node", you get the number of children of this node via node.children.length
see ScriptNode API | Alfresco Documentation
or use childFileFolders | Alfresco Documentation
node.childFileFolders(true, false).length
there you can choose to get all files, directories or files and directories...
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.