Chris,
I didn't want to mess with a file upload component, so I just FTP the
image files to a specific directory. After they are on the website, I
use the admin page to enter the filename & caption into a database. I
originally thought I would just key in the filenames as they are
uploaded, which works just fine.
A better admin page would look for any files in the gallery directory
that are not in database and populate a drop down menu with them. So I
want to create one array from a scripting.filesystemobject with every
filename in the directory, and create a second with each entry in the
database, and run a set operation to leave only those filenames that
are in the image directory but not in the database.
Perhaps I'm looking for more out of ASP than it can do, but I think
it's always a good idea to look for innovative solutions rather than
just cranking out inefficient code.
Thanks a lot,
John
"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message news:<#i*************@TK2MSFTNGP11.phx.gbl>...
Do all the filenames exist in the database or is this a loosely coupled
system where there may be more or less images in the directory than exist in
the database?
Chris.
"John Hoge" <jh******@yahoo.com> wrote in message
news:d0*************************@posting.google.co m...
I'm looking to make an admin page for a web photo gallery, and I need
to make a drop down menu showing all files in a given directory that
do not have comments in a database for the given filename.
I'm curious about the most efficient way to do this. I don't want to
query the database separately for each file as this would be horribly
inefficient. I'm thinking about two arrays, one containing all
filenames in the photo directory, and one containing filenames from
the database that have descriptions.
Is there a simple way in ADO to do a set operation on arrays, that is
to produce array C that has all elements in array A that are not
contained in array B?
I can do this with while loops, but there must be a better way!
John