I want to get all the file names and sub folders names in JavaScript. But, in my code the activeX object method is not working. Could you find the problem in my code please?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Report Interface</title>
<script type="text/javascript">
function FindFile(FOo)
{
var fs = new ActiveXObject("Scripting.FileSystemObject");
var Folder = fs.GetFolder(FOo);
var FileCollection = Folder.Files;
var Files = new Array();
for(var objEnum = new Enumerator(FileCollection); !objEnum.atEnd(); objEnum.moveNext())
{
strFileName = objEnum.item();
alert(strFileName);
}
}
</script>
</head>
<body>
<script type="text/javascript">
window.onload = function()
{
var file_path = "C:/xampp/tomcat/webapps/brt-example/report"; // Starting directory
FindFile(file_path);
}
</script>
</body>
</html>