Ah - you didn't say a web server folder.
Then yes, but JS can't do this by itself, you'll need something like PHP which will then return the files to JS via ajax.
Here's a simple PHP script to read all files in a dir:
<?php
$dir = "/etc/php5/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
}
closedir($dh);
}
}
?>