Hello all,
i was wondering if there was a script out there that can see what files are in a particular folder then show them in a web "file browser", Any help:confused:
Printable View
Hello all,
i was wondering if there was a script out there that can see what files are in a particular folder then show them in a web "file browser", Any help:confused:
This is impossible in all web languages as it would constitute a major security risk. The closest you can come is to use an file upload field field to allow people to browse local folders on their computer, but even that won't return the list of files to JS.
so not even if the folders are on the webserver
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:
Code:<?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);
}
}
?>
is there a way to put it into a table with my own icons and the actual folder names because when i added that nothing happend