Ask a Question related to ASP Components, Design and Development.

  1. #1

    Default File Listing

    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 Guest

  2. Similar Questions and Discussions

    1. #39481 [NEW]: I have got file listing of /
      From: zxc at zmail dot ru Operating system: FreeBSD 6.1 PHP version: 4.4.4 PHP Bug Type: *Directory/Filesystem functions Bug...
    2. Listing
      Hello, I am just working on a text where I need to use listing symbols like in MS Word (dash oder points). But I cannot find anything like that in...
    3. Listing absolute path of file
      In article <1069154646.787003@internet.fina.hr>, Pipiron wrote: This will do it recursively: find /path/to/dir -print --
    4. How to get a remote file listing in PHP
      I was running into a problem where I needed a PHP function to get the directory listing of a remote HTML directory. I scoured posts and a few said...
    5. .htaccess file to prevent listing of directories.
      I created a .htaccess file to prevent people from browing some of my directories. The file contained: IndexIgnore *.gif *.jpg When I then go...
  3. #2

    Default Re: File Listing

    "Marco Pais" <marco.pais@[IGNORE]gmail.com> wrote in message
    news:Obuf1xz0GHA.1588@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:
    >
    > <%@ 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.
    You might consider having one page generate the multiple pages of pictures
    along with an "include" file that identifies these pages; the "include"
    would
    be part of another page that from which the images pages could be selected.

    Whenever images are added to or removed from the folder then you (not
    your visitors) would regenerate the static pages and the "include" file.

    Are all of the images in the folder the same dimensions? If not, do you
    want them all displayed with the same width -- to ensure that they'll all
    fit on a page without requiring horizontal scrolling by the visitor?


    Note -- you could use "filename.Name" instead of extracting the it via:
    > Filename=right(Filename,len(Filename)-InStrRev(Filename, "\"))

    McKirahan Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139