Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading directory contents 1

Status
Not open for further replies.

PapaGLP

Technical User
Jul 19, 2002
31
US
I'm trying to read the contents of a directory on my web server onto a web site. I have a directory of files on an upload server and i need the web site to be able to display all the files of a certain type (.xls) on a web page. Any ideas on approaches to this problem?
 
you can do this using ASP - is this an option for you before I go into details??
Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
It is a possibility. I'm rather inexperienced with it but it's worth a shot.
 
try this:

Code:
<%
strFolder = &quot;c:\&quot;

Set objFSO = Server.CreateObject(&quot;Scripting.FileSystemObject&quot;)
Set objFolder = objFSO.GetFolder(strFolder)

For Each strFile In objFolder.Files
  If Right(strFile,3) = &quot;xls&quot; Then
    Response.Write &quot;<A>&quot; & strFile.Name & &quot;</A><BR>&quot; & vbcrlf
  End If
Next

Set objFolder = Nothing
Set objFSO = Nothing
%>
Tony
reddot.gif WIDTH=300 HEIGHT=2 VSPACE=3

 
strFolder being the directory i have my files in?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top