Excluding Folders and Files in FSO

This is a discussion on "Excluding Folders and Files in FSO" within the Classic ASP section. This forum, and the thread "Excluding Folders and Files in FSO are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1  
Old Nov 12th, 2003, 16:41
New Member
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Excluding Folders and Files in FSO

Does anyone know what code to use to exclude folders name showing on display?

I want to let users browse contents of a particular folder and look at the files in the folder. but not see any folder names inside.

and also to exclude viewing files like .asp, .asa. etc.

Any suggestions.

<font color="green"></font id="green">
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Nov 12th, 2003, 17:03
Reputable Member
Join Date: Sep 2003
Location: USA
Posts: 112
Thanks: 0
Thanked 0 Times in 0 Posts
I use this to print out all the .xls files, you could use something similar with <> asp and <> asa

Code: Select all
	for each x in fo.files
	  'Print the name of all files in the test folder
	   if right(x.Name, 3) = "xls" then 
			Response.write "<tr><td>" & x.Name & "</td>"
			response.write "<td> " & x.DateLastModified & " </td></tr>"
		end if
	next
jakyra
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Nov 12th, 2003, 18:10
New Member
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks. I was actually looking for code to exclude a file and or a folder being viewed, so what's the code to hide the display of objects?

Response.write outputs to display

Thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Nov 12th, 2003, 19:01
Rob's Avatar
Rob Rob is offline
Webforumz Founder
Join Date: Jul 2003
Location: Southern UK
Age: 34
Posts: 3,160
Blog Entries: 7
Thanks: 27
Thanked 19 Times in 16 Posts
ok... i have not tested this but try something like:-
Code: Select all
'create a string of dissallowed extensions (lowercase)
DissallowList = "|asp|asa|aspx|"
for each x in fo.files
          FileExt = Mid(x.Name, InStrRev(x.Name, ".")+1, Len(x.Name) - InStrRev(x.Name, ".") + 1)
          If Instr(DissallowList,"|" & lcase(FileExt) & "|") = 0 Then
	  	'Print the name of all files in the test folder
	   	Response.write "<tr><td>" & x.Name & "</td>"
		response.write "<td> " & x.DateLastModified & " </td></tr>"
	  End If
next
Hope This helps!
__________________
Click the 'Thanks!' button if this post has helped you

Rob - Webforumz Founder
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
excluding, folders, files, fso

Thread Tools

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Organising Website Files - Folders Stop My Pages from Displaying thebagman Website Planning 10 Sep 4th, 2007 22:12
How do you made folders that are... simonb Webforumz Cafe 9 Jul 25th, 2007 21:12
_vti sub folders and be nice its my birthday lol EnSComputers Webforumz Cafe 24 May 10th, 2007 11:06
Browsing Folders paradisewolf JavaScript Forum 3 Mar 16th, 2007 20:03
Checking Folders for images... JohnMitch Classic ASP 9 Oct 20th, 2004 12:33


All times are GMT. The time now is 21:59.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42