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

Re: File Listing by Mike

Mike
Fri Sep 08 10:02:36 CDT 2006


Marco Pais wrote:
> 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/microsoft.public.inetserver.asp.general/browse_frm/thread/b6e9c622948e11b3/e390ca1251be50cc?lnk=gst&q=paging+list+of+files&rnum=2#e390ca1251be50cc

--
Mike Brind


Re: File Listing by McKirahan

McKirahan
Fri Sep 08 14:30:32 CDT 2006

"Marco Pais" <marco.pais@[IGNORE]gmail.com> wrote in message
news:eLRQirz0GHA.1548@TK2MSFTNGP02.phx.gbl...
> 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