Ask a Question related to ASP, Design and Development.
-
Dave Navarro #1
Getting a list of files in a folder
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
Dave Navarro Guest
-
Help with script to list non-html files in folder
Hi I have this code but it does not seem to list non-html files. Could anyone point me in the right direction. Thanks in advance Mark -
How to tell what swf files are in a folder?
If no one knows the answer, how about a suggestion about where I might find the answer. -
List Files in a Web Folder
Hi All I want to create a webpage which will list all the files in particular folder and hyperlink to them to allow users to view the grpahics... -
List items in a folder
I would like to be able to list a directory (or something like it)of the contance of a certian folder. How can this be done on a web page? TIA Jim -
Print folder list
Hi Charles, See: HOW TO: Add "Print Directory" Feature for Folders in Windows XP http://support.microsoft.com/?kbid=321379 -- Best of... -
Richard K Bethell #2
Re: Getting a list of files in a folder
"Dave Navarro" <dave@dave.dave> wrote in message
news:MPG.19f804812bd590e989763@news-40.giganews.com...Here is an approach that might seem a little odd, but it could work.> 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?
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.
Richard K Bethell Guest
-
Ray at #3
Re: Getting a list of files in a folder
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
Ray at Guest
-
David P. Jessup #4
Re: Getting a list of files in a folder
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...nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl> Hi Dave,
>
> See this post and replies for some other suggestions.
>>
> 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
>
David P. Jessup Guest
-
Ray at #5
Re: Getting a list of files in a folder
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...nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.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.
> >> >
Ray at Guest
-
David P. Jessup #6
Re: Getting a list of files in a folder
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...directly> 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 linksnntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl> 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.
> > >>> > >
>
David P. Jessup Guest
-
ljb #7
Re: Getting a list of files in a folder
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...nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.phx.gbl> Hi Dave,
>
> See this post and replies for some other suggestions.
>>
> Ray at work
ljb Guest
-
Jeff Cochran #8
Re: Getting a list of files in a folder
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...>nntp://msnews.microsoft.com/microsoft.public.inetserver.asp.general/#YSoD8okDHA.744@tk2msftngp13.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.
>> >>>> >Jeff Cochran Guest



Reply With Quote

