If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Checking for files?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-20-02, 01:46
simmo simmo is offline
Registered User
 
Join Date: May 2002
Location: Sydney
Posts: 15
Checking for files?

Hi,

I want to be able to check and find files if they exist.

The only problem is i don't know specifically what the file name will be. I know that a certain number will exist in the file name (e.g. 8056) but there will be other letters and numbers following that will vary.

For example there could be file names called C8056S.CPX, C8056LG1.CPX, C8056LG2.CPX, C8056LG3.CPX, C8056LG4.CPX....etc

Is there any way that i can check for all these using something of the sorts of a wildcard search (E.g *8056*.CPX)??

Any help would be greatly appreciated

Simon
Reply With Quote
  #2 (permalink)  
Old 06-27-02, 09:53
JonathanB JonathanB is offline
Registered User
 
Join Date: Feb 2002
Location: North Wales, UK
Posts: 114
Hmm... I'm not aware of any asp objects that would allow you to do this. But I have to ask.. if you know a certain amount about the filename there must be some logic to the rest of the filename?? Of course I'm assuming they are being generated by another application....
__________________
J^ - web | email
newsASP Developer
Reply With Quote
  #3 (permalink)  
Old 08-21-02, 08:31
EvE EvE is offline
Registered User
 
Join Date: Aug 2002
Location: Holland
Posts: 16
I hope I understood you well, but here is my suggestion:

<HTML>
<HEAD><TITLE> Showing files</TITLE></HEAD>
<BODY>

<%
Set fs = Server.CreateObject( "Scripting.FileSystemObject")
Set folder = fs.Getfolder("c:\My Documents\TestSite\test\fso-object")
FOR EACH file IN folder.Files
%>
<br> <a href ="<%=file.Name%>"><%=file.Name%></a>
<%
NEXT
%>
</BODY>
</HTML>
Reply With Quote
  #4 (permalink)  
Old 08-26-02, 12:47
kanejone kanejone is offline
Registered User
 
Join Date: Aug 2002
Posts: 3
Just a little addition to Eve's code. Hope this helps. I needed the same type of thing a while ago and remember a good sample from www.asp101.com.

The link is http://www.asp101.com/samples/dir_list_sort.asp
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On