 <p>would a php only solution work for you?</p> <pre><code> function list_directories($dir){ $temp_dir = $_SERVER['DOCUMENT_ROOT'].$dir; if (is_link($dir)) { echo "do nothing"; } else { $pattern = '/./'; $bad = array(".", "..", ".DS_Store", "Thumbs.db", ".svn", ".git"); $class = 'dir'; $contents = scandir($temp_dir,1); $files = array_diff($contents, $bad); krsort($files); echo "&lt;ul&gt;"; foreach($files as $item){ $file_extension = strtolower(substr(strrchr($item,"."),1)); echo "&lt;li&gt;&lt;a href='http://".$_SERVER['SERVER_NAME'].$dir.$item."'&gt;".$item."&lt;/a&gt;&lt;/li&gt;"; } echo "&lt;/ul&gt;"; } } </code></pre>