File Listing

File Listing

am 08.09.2006 13:46:52 von 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 %>


<%
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 "" & filename
& "

"
Next
%>



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

am 08.09.2006 17:14:42 von Mike Brind

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 %>
>
>
> <%
> 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 "" & filename
> & "

"
> Next
> %>
>
>
>
> 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.
>

Please don't multipost, Marco. If you are unsure of the group to which
your question belongs, then crosspost if you have to. In this case,
your question has nothing to do with databases, and does not belong in
this group. It belongs in the group you first posted to - general,
where I have provided a link for you which should help

--
Mike Brind