I have a folder on the server with several thousand image files in it.

I am using the following code to retrieve the image names associated
with a given MLS number (this is for a real estate web site):

Function MlsPicList(ByVal mls)
path = MlsPath(mls) & "*.jpg"
Dim fso
Set fso = CreateObject("Scripting.FileSystemObject")
parent = fso.GetParentFolderName(path)
Set fold = fso.GetFolder(parent)
for each file in fold.Files
If Left(file.name, LEN(mls)) = mls Then
pic = MlsPicture(Left(file.name, Len(file.name) - 4), area)
temp = temp & "," & Chr(34) & pic & Chr(34)
End If
next
MlsPicList = Mid(temp, 2)
set fold = nothing
set fso = nothing
End Function

Since I can't specify a filespec with a wildcard, my code has to loop
through ALL of the filenames to find those that I need.

Beyond putting all of the filenames into an indexed database (not really
possible, the folder is updated with new and modified images hourly), is
there a faster way to get just the files that I need?

--Dave

Re: Getting a list of files in a folder by Richard

Richard
Thu Oct 16 08:04:06 CDT 2003

"Dave Navarro" <dave@dave.dave> wrote in message
news:MPG.19f804812bd590e989763@news-40.giganews.com...
> Beyond putting all of the filenames into an indexed database (not really
> possible, the folder is updated with new and modified images hourly), is
> there a faster way to get just the files that I need?

Here is an approach that might seem a little odd, but it could work.

Say as a once-every-ten-minute scheduled job on the server - toss the name
of every file into an XML document that looks like the ADODB AdPersistXML
format. Then, when your ASP page calls this function, open the adPersistXML
document as an ADODB.Recordset and use the recordset's "Find" method to
narrow your criteria.

R.




Re: Getting a list of files in a folder by Ray

Ray
Thu Oct 16 08:12:09 CDT 2003

Hi Dave,

See this post and replies for some other suggestions.
nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl

Ray at work

"Dave Navarro" <dave@dave.dave> wrote in message
news:MPG.19f804812bd590e989763@news-40.giganews.com...
> I have a folder on the server with several thousand image files in it.
>
> I am using the following code to retrieve the image names associated
> with a given MLS number (this is for a real estate web site):
>
> Function MlsPicList(ByVal mls)
> path = MlsPath(mls) & "*.jpg"
> Dim fso
> Set fso = CreateObject("Scripting.FileSystemObject")
> parent = fso.GetParentFolderName(path)
> Set fold = fso.GetFolder(parent)
> for each file in fold.Files
> If Left(file.name, LEN(mls)) = mls Then
> pic = MlsPicture(Left(file.name, Len(file.name) - 4), area)
> temp = temp & "," & Chr(34) & pic & Chr(34)
> End If
> next
> MlsPicList = Mid(temp, 2)
> set fold = nothing
> set fso = nothing
> End Function
>
> Since I can't specify a filespec with a wildcard, my code has to loop
> through ALL of the filenames to find those that I need.
>
> Beyond putting all of the filenames into an indexed database (not really
> possible, the folder is updated with new and modified images hourly), is
> there a faster way to get just the files that I need?
>
> --Dave



Re: Getting a list of files in a folder by David

David
Thu Oct 16 09:04:56 CDT 2003

Hehe,

Ray I was going to point him to this thread =)

--
Thanks from this ASP Newbie
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ejilcc%23kDHA.2444@TK2MSFTNGP09.phx.gbl...
> Hi Dave,
>
> See this post and replies for some other suggestions.
>
nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl
>
> Ray at work
>
> "Dave Navarro" <dave@dave.dave> wrote in message
> news:MPG.19f804812bd590e989763@news-40.giganews.com...
> > I have a folder on the server with several thousand image files in it.
> >
> > I am using the following code to retrieve the image names associated
> > with a given MLS number (this is for a real estate web site):
> >
> > Function MlsPicList(ByVal mls)
> > path = MlsPath(mls) & "*.jpg"
> > Dim fso
> > Set fso = CreateObject("Scripting.FileSystemObject")
> > parent = fso.GetParentFolderName(path)
> > Set fold = fso.GetFolder(parent)
> > for each file in fold.Files
> > If Left(file.name, LEN(mls)) = mls Then
> > pic = MlsPicture(Left(file.name, Len(file.name) - 4), area)
> > temp = temp & "," & Chr(34) & pic & Chr(34)
> > End If
> > next
> > MlsPicList = Mid(temp, 2)
> > set fold = nothing
> > set fso = nothing
> > End Function
> >
> > Since I can't specify a filespec with a wildcard, my code has to loop
> > through ALL of the filenames to find those that I need.
> >
> > Beyond putting all of the filenames into an indexed database (not really
> > possible, the folder is updated with new and modified images hourly), is
> > there a faster way to get just the files that I need?
> >
> > --Dave
>
>



Re: Getting a list of files in a folder by Ray

Ray
Thu Oct 16 09:16:01 CDT 2003

I thought it was you with a fake name at first. ;] I wonder if that link
will even do him any good though. I'm beta testing the nntp links directly
to article IDs. I don't think that's ideal though, since (at least in my
newsreader) there is no, "next message in this thread" button...

Ray at work

"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
news:eQVy75%23kDHA.2140@TK2MSFTNGP09.phx.gbl...
> Hehe,
>
> Ray I was going to point him to this thread =)
>
> --
> Thanks from this ASP Newbie
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> news:ejilcc%23kDHA.2444@TK2MSFTNGP09.phx.gbl...
> > Hi Dave,
> >
> > See this post and replies for some other suggestions.
> >
>
nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl
> >



Re: Getting a list of files in a folder by David

David
Thu Oct 16 09:25:15 CDT 2003

Heh,

Yeah, just noticed his name is "Dave". Well I'm David and this isn't me
posting trying to get a different question. =)

--
Thanks from this ASP Newbie
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:eXlfIA$kDHA.3732@tk2msftngp13.phx.gbl...
> I thought it was you with a fake name at first. ;] I wonder if that link
> will even do him any good though. I'm beta testing the nntp links
directly
> to article IDs. I don't think that's ideal though, since (at least in my
> newsreader) there is no, "next message in this thread" button...
>
> Ray at work
>
> "David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
> news:eQVy75%23kDHA.2140@TK2MSFTNGP09.phx.gbl...
> > Hehe,
> >
> > Ray I was going to point him to this thread =)
> >
> > --
> > Thanks from this ASP Newbie
> > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
> > news:ejilcc%23kDHA.2444@TK2MSFTNGP09.phx.gbl...
> > > Hi Dave,
> > >
> > > See this post and replies for some other suggestions.
> > >
> >
>
nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl
> > >
>
>



Re: Getting a list of files in a folder by ljb

ljb
Thu Oct 16 13:01:46 CDT 2003

The referenced example works for me only when run as a local *.vbs file. Run
as *.asp on a server always returns 0 files with the same pattern and UNC
location. Is this caused by a security issue?

thanks
LJB

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:ejilcc%23kDHA.2444@TK2MSFTNGP09.phx.gbl...
> Hi Dave,
>
> See this post and replies for some other suggestions.
>
nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl
>
> Ray at work



Re: Getting a list of files in a folder by jcochran

jcochran
Thu Oct 16 15:06:11 CDT 2003

My news reader doesn't even like the URL, says it's invalid. Agent
1.5/32.451

Jeff

On Thu, 16 Oct 2003 10:16:01 -0400, "Ray at <%=sLocation%>"
<myfirstname at lane34 dot com> wrote:

>I thought it was you with a fake name at first. ;] I wonder if that link
>will even do him any good though. I'm beta testing the nntp links directly
>to article IDs. I don't think that's ideal though, since (at least in my
>newsreader) there is no, "next message in this thread" button...
>
>Ray at work
>
>"David P. Jessup" <davidATimntDASHtechDOTcom> wrote in message
>news:eQVy75%23kDHA.2140@TK2MSFTNGP09.phx.gbl...
>> Hehe,
>>
>> Ray I was going to point him to this thread =)
>>
>> --
>> Thanks from this ASP Newbie
>> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
>> news:ejilcc%23kDHA.2444@TK2MSFTNGP09.phx.gbl...
>> > Hi Dave,
>> >
>> > See this post and replies for some other suggestions.
>> >
>>
>nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl
>> >
>