File Listing

Discussion in 'ASP General' started by Marco Pais, Sep 8, 2006.

  1. Marco Pais

    Marco Pais Guest

    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
     
    Marco Pais, Sep 8, 2006
    #1
    1. Advertising

  2. Marco Pais

    Mike Brind Guest

    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/mi...=paging list of files&rnum=2#e390ca1251be50cc

    --
    Mike Brind
     
    Mike Brind, Sep 8, 2006
    #2
    1. Advertising

  3. Marco Pais

    McKirahan Guest

    "Marco Pais" <marco.pais@[IGNORE]gmail.com> wrote in message
    news:...
    > 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
     
    McKirahan, Sep 8, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGVhc3Vu?=
    Replies:
    1
    Views:
    375
    Karl Seguin
    Jul 12, 2005
  2. Ferman
    Replies:
    4
    Views:
    498
    Roedy Green
    Aug 13, 2003
  3. Leif K-Brooks
    Replies:
    6
    Views:
    754
    Guest
    Dec 16, 2003
  4. paul
    Replies:
    9
    Views:
    393
    Jonathan N. Little
    Aug 25, 2005
  5. Dave Kuhlman

    ANN: zip-ls -- Zip file listing program

    Dave Kuhlman, Jul 19, 2003, in forum: Python
    Replies:
    0
    Views:
    416
    Dave Kuhlman
    Jul 19, 2003
Loading...

Share This Page