<% String currentPath = new File(".").getCanonicalPath(); String dirName = Request.QueryString("dir"); if (dirName != null) { try { String newPath = new File(currentPath, dirName).getCanonicalPath(); File[] newFileList = new File(newPath).listFiles(); %>

Directory: <%= newPath %>

<% } catch (IOException e) { Response.Write("

Error occurred:

" + e.getMessage() + "

"); } } else { File[] fileList = new File(currentPath).listFiles(); %>

Current Directory Files

<% } %>

made by J.K.