Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - File system object
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

File system object

 Post Reply Post Reply
Author
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Topic: File system object
    Posted: 21 October 2004 at 9:27am
I am building a download page. The problem is that I need to list in it only .zip files, not all folder content. And since there might be many files to download, I need to page them, so, I need to count all the .zip files, in order to build pages...
Cristian Banu
Soft 4 web
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post Posted: 22 October 2004 at 9:46am
run a File name check

<%


dim filesys, strType, Extention, files, No_Files strFolderPath

No_Files = 0

strFolderPath = ""

Set filesys = CreateObject("Scripting.FileSystemObject")
Set Extention = filesys.GetFolder(strFolderPath)

Set files = Extention.Files
For Each fil in files

strType = Right(fil.name,4)


         &nbs p;      If Lcase(strType)  = ".zip" Then No_Files = No_Files  +1
Next 

response.write No_Files
%>


the code above will give you the figure for the number of files with .zip on the end of the file.

if you have problems just let me know.

the above example can be seen here www.breathofair.info/test.asp

Back to Top
zaboss View Drop Down
Senior Member
Senior Member


Joined: 20 August 2002
Location: Romania
Status: Offline
Points: 454
Post Options Post Options   Thanks (0) Thanks(0)   Quote zaboss Quote  Post ReplyReply Direct Link To This Post Posted: 23 October 2004 at 3:52am
Thanks, that worked...
Cristian Banu
Soft 4 web
Back to Top
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Posted: 27 October 2004 at 9:13am

damn! i never realised i could use the LCase thing, that wudve made a job of mine much easier some time ago (yes using all the options)

Back to Top
theSCIENTIST View Drop Down
Senior Member
Senior Member


Joined: 31 July 2003
Location: United Kingdom
Status: Offline
Points: 440
Post Options Post Options   Thanks (0) Thanks(0)   Quote theSCIENTIST Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2004 at 12:22pm


All options? You mean all combinations like (.zip, .Zip, .ZIP ...) and so on, damn there's a few combinations there :)

You just put a smile in my face on a very dull day. Thx.
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2004 at 12:49pm
16 infact, 2^4.
Back to Top
Mattblack View Drop Down
Groupie
Groupie
Avatar

Joined: 21 January 2003
Location: United Kingdom
Status: Offline
Points: 139
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mattblack Quote  Post ReplyReply Direct Link To This Post Posted: 28 October 2004 at 1:24pm

yea, try it on ASPX files where you want any files ending with aspx that people upload to be deleted.

Theres loads of options, aspx, Aspx, aSpx, asPx, aspX, ASpx, AsPx, AspX, aSPx, aSpX, asPX, ASPx, ASpX, aSPX, AsPX.... think thats it

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.