|
-
May 22nd, 2000, 09:06 PM
#1
Thread Starter
Junior Member
Something about the number of responses here tells me I wont get an answer anytime in the near future... But i'm gonna ask anyway...
I'm making a webpage for file downloads, and I want it to always be current with the files that are available in the directory.
I figured if there was some way to get a HTML listing of the files in the directory, it would really take a load off. Anyone have a clue?
<~Whisper~>
-
May 24th, 2000, 03:29 AM
#2
Hyperactive Member
Do you have access to any server side programming/scripting for this page?
"People who think they know everything are a great annoyance to those of us who do."
-
May 24th, 2000, 06:35 AM
#3
Thread Starter
Junior Member
Yes. I have full access to everythin... Fire away!!
-
May 25th, 2000, 12:27 AM
#4
New Member
Does full access mean you have a cgi-bin directory that you can put scripts in that can be executed from a client browser?
-
May 25th, 2000, 06:33 AM
#5
Hyperactive Member
If you can run ASP pages this might help you out:
http://www.asptoday.com/articles/19990319.htm
"People who think they know everything are a great annoyance to those of us who do."
-
May 25th, 2000, 08:36 PM
#6
If you have rights to run ASP scripts and create an instance of the "Scripting.FileSystemObject" object then this code should be good for you:
Code:
<%@ Language=VBScript %>
<html>
<head>
<title>News & Bulletins</title>
</head>
<body bgcolor="#FFFFFF" link="#FF9A09" text="#000099" vlink="#000099">
<font face="Arial">
<%
dim Files, Folder, fsoFile
set fsoFile = Server.CreateObject("Scripting.FileSystemObject")
set Folder=fsoFile.GetFolder(server.MapPath("."))
set files = Folder.Files
if files.count<>0 then
for each file in files
if lcase(right(file,5)) = ".html" then
%>
<a href="<%=server.urlpathencode(fsoFile.GetBaseName(file))%>.html"><%=fsoFile.GetBaseName(file)%></a><br>
<%
end if
next
end if
set fsoFile = Nothing
%>
</font>
</body>
</html>
As it stands the code only lists ".html" files and hides the file extension (but I'm sure a smart person like you can sort that out! )
As for the colour scheme... Lets just say that it looks ok when you see the rest of the site I created it for (corporate colours and all that).
Chiow!
[Edited by matthewralston on 05-26-2000 at 09:49 AM]
-
Jun 5th, 2000, 11:54 PM
#7
Monday Morning Lunatic
depending on how the server's set up, if you just don't put an index.html file (or something similar) in a folder, you either get a directory listing generated by the client browser, or a message telling you it's forbidden to browse. If the former, then you're fine, if the latter, then the clever people here have already told you what to do.
-
Jun 6th, 2000, 01:59 AM
#8
Thread Starter
Junior Member
Verry nice, matthewralston... I had originaly used the "no-html file in the directory" (tacky) method of creating a file listing, but it seems this works very efficiently
Thanx a million...
~~Whisper~~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|