|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
I need to find a file but only have partial name
I'm looking for images in my asp page.
I know the path and first and last part of the filename. Example filename: A01-30420.jpg I have the A01- and the .jpeg. The ##### portion could be anything, but always numeric (sofar). The A01 is unique, i.e. there will only be one file of A01-#####.jpg I'm using fileExists object to confirm a file exists when I have the full filename but havn't been able to figure out how to get the full filename when I only have a partial. I could rename the files, i.e. drop the -##### but I'd have to do that everytime I get new ones so I'd like to work with the original filename if at all possible. Thanks in advance Heinz |
|
#2
|
||||
|
||||
|
Think you could just get all of the files:
dir=server.MapPath(somedir) Set fso = CreateObject("Scripting.FileSystemObject") Set files = fso.GetFolder(dir) then just use a loop to look for it... i think you could even have somedir be C:\foo.* but i am not 100% sure on that |
|
#3
|
|||
|
|||
|
Thanks Tron.
I did sort of a stopgap using basically what you described in an asp page to permanently rename and then I can look for the name directly. Maybe next time I get a bunch I'll rethink/redo :-)) Heinz |
|
#4
|
||||
|
||||
|
so i guess you figured it out??
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > I need to find a file but only have partial name |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|