CodeAve.com CodeAve.com - ASP - Read/Write
ASP
·Read/Write
·Script Writers
·Database Display
·Response Objects
·Server Variables
·Random Events
·Articles
·Miscellaneous
·Contents
·What's New?
JavaScript
CSS
HTML
Maps
Links
Mail List
Search
Sitemap


 


Directory Contents (With Images)
Need to create a directory view with images? This script will generate a view with images of all directory contents (files and sub-directories). Just change server.mappath("directories/")) to server.mappath("your directory /")) Note: A filter is applied to remove all MSFrontPage 2000 directories ending in _cnf from the output. and is limited to displaying images for files ending in .pdf, .asp, .txt, .html, .htm, .doc, .asp, .xls, .mdb, .ppt and will display a generic image for all files other than those listed.
View the Output
Text View
Print View
Mail this Link
Download the Code

Folders
<br>
<%
Set directory=server.createobject("scripting.filesystemobject")
Set allfiles=directory.getfolder(server.mappath("directories/"))

' Lists all the files found in the directory
For each directoryfile in allFiles.subfolders
%>
<% ' Removes certain MSFrontPage was directories 
if right(directoryfile.Name,3) <> "cnf" then %>

<a href="directories/<% =directoryfile.Name %>" target="_blank">
<% =directoryfile.Name %></a>
<br>
<% end if %>
<% Next %>

<br>
Files
<br>
<% ' Lists all the files found in the directory
For each directoryfile in allFiles.files %>

<a href="directories/<% =directoryfile.Name %>">
<% 
ext=right(directoryfile.Name,3)
select case ext 
case "pdf","asp","htm","mdb","xls","ppt","doc","txt" %>

<img src="directories/images/<%= ext %>.jpg" border="0">
<% case else %>
<img src="directories/images/unk.jpg" border="0">
<% end select %>
<% =directoryfile.Name %></a>
<br>
<% Next %>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
  • 2014 michael kors
  • air max women 2013
  • 2014 michael kors
  • air max 2014
  • oakley glasses
  • oakley glasses

  • Maps: Map Script Writers | Bing Maps | Google Maps
  • bottes fr
  • ugg boot
  • Privacy Statement

    CodeAve.com is hosted by MyHosting.com
    Donate Food Online with a Mouse Click at TheHungerSite.com
    Donate Land Online with a Mouse Click at TheRainForestSite.com
    © 1999 - 2017 CodeAve.com
    All Rights Reserved

  • Kids jordan 6 rings
  • Jordan retro 10
  • Jordan retro 3