Skip to main content
Inspiring
March 16, 2007
Question

image selection from directory list?

  • March 16, 2007
  • 1 reply
  • 225 views
Hi, I'm working with ASP/VBScript.

I'm creating an INSERT form and I'd like to be able to allow people to view
a list of images held in a specific directory on the server. When they
click on the image they want, this pre-fills a form field with the file
name. Is there an extension for this? I'm struggling to find anything that
isn't ASP.NET.

Thanks.
Nath.


This topic has been closed for replies.

1 reply

Inspiring
March 16, 2007
Bit of digging around and I've found the following:

<%
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("../graphics/tmbs/"))
For each filefound in MyFiles.files
%>

<% =filefound.Name %>
<br />

<% Next %>

This gives me a list of file names within that directory, similar to the
following:
image1.gif
image2.gif
image3.gif

So, I have altered that code further to be:

<%
Set MyDirectory=Server.CreateObject("Scripting.FileSystemObject")
Set MyFiles=MyDirectory.GetFolder(Server.MapPath("../graphics/tmbs/"))
For each filefound in MyFiles.files
%>

<img src="../graphics/tmbs/<% =filefound.Name %>" />
<br />

<% Next %>

...and this is neatly displaying the images in a list. Hurrah!
How would I alter the above code in order to show 3 images in a row though,
like a Horizontal repeat region?

Thanks.
Nath.

"tradmusic.com" <sales@NOSHPAMtradmusic.com> wrote in message
news:ete18c$3br$1@forums.macromedia.com...
> Hi, I'm working with ASP/VBScript.
>
> I'm creating an INSERT form and I'd like to be able to allow people to
> view a list of images held in a specific directory on the server. When
> they click on the image they want, this pre-fills a form field with the
> file name. Is there an extension for this? I'm struggling to find
> anything that isn't ASP.NET.
>
> Thanks.
> Nath.
>