File Listing

M

Marco Pais

Hi there.

First of all, sorry for my poor english.

I have a problem that I don't know how to resolve. I want to make a dynamic
image gallery. With an ASP script, I will read the images from a folder and
display them on a table, for example. The script is something like this:

<%@ Language=VBScript %>
<HTML>
<BODY>
<%
Dim objFileScripting, objFolder
Dim filename, filecollection, strDirectoryPath, strUrlPath
strDirectoryPath="c:\inetpub\scripts\"
strUrlPath="\scripts\"

'get file scripting object
Set objFileScripting = CreateObject("Scripting.FileSystemObject")
'Return folder object
Set objFolder = objFileScripting.GetFolder("c:\inetpub\scripts\")
'return file collection In folder
Set filecollection = objFolder.Files
'create the links
For Each filename In filecollection
Filename=right(Filename,len(Filename)-InStrRev(Filename, "\"))
Response.Write "<A HREF=""" & strUrlPath & filename & """>" & filename
& "</A><BR>"
Next
%>
</BODY>
</HTML>

This one is not finihed yet (read only images and display them on a table).
But my problem is this: what can I do so I can read 10 files each time,
separated in several pages. So, if I have 100 image files in my folder, I
will have 10 pages, each one with a table conatining 10 images.

Thanks for any help.

Regards,

Marco Pais
 
M

Mike Brind

Marco said:
Hi there.

First of all, sorry for my poor english.

I have a problem that I don't know how to resolve. I want to make a dynamic
image gallery. With an ASP script, I will read the images from a folder and
display them on a table, for example. The script is something like this:

<%@ Language=VBScript %>
<HTML>
<BODY>
<%
Dim objFileScripting, objFolder
Dim filename, filecollection, strDirectoryPath, strUrlPath
strDirectoryPath="c:\inetpub\scripts\"
strUrlPath="\scripts\"

'get file scripting object
Set objFileScripting = CreateObject("Scripting.FileSystemObject")
'Return folder object
Set objFolder = objFileScripting.GetFolder("c:\inetpub\scripts\")
'return file collection In folder
Set filecollection = objFolder.Files
'create the links
For Each filename In filecollection
Filename=right(Filename,len(Filename)-InStrRev(Filename, "\"))
Response.Write "<A HREF=""" & strUrlPath & filename & """>" & filename
& "</A><BR>"
Next
%>
</BODY>
</HTML>

This one is not finihed yet (read only images and display them on a table).
But my problem is this: what can I do so I can read 10 files each time,
separated in several pages. So, if I have 100 image files in my folder, I
will have 10 pages, each one with a table conatining 10 images.

This thread from a few months back should give you a starting point:

http://groups.google.co.uk/group/mi...=paging+list+of+files&rnum=2#e390ca1251be50cc
 
M

McKirahan

Marco Pais said:
Hi there.

First of all, sorry for my poor english.

I have a problem that I don't know how to resolve. I want to make a dynamic
image gallery. With an ASP script, I will read the images from a folder and
display them on a table, for example. The script is something like this:

[snip]

See microsoft.public.inetserver.asp.components

http://www.aspfaq.com/5003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top