472,977 Members | 1,847 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,977 software developers and data experts.

Able to list and display all file names in a folder but how to iterate the filenames?

Hi, i want to display all the filenames on browser. However i found that if there are many filenames in that folder, result will be it will display a long list of filenames on that browser.

My question is how do i iterate the file names with 5 filenames on each page?

I have manage to retrieve and display the filenames with the codes below. Can anyone help me or give advice on how to do the iteration?
The codes are below and able to list filenames
Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %> 
  2.     <HTML> 
  3.     <BODY> 
  4.     <% 
  5.     Dim objFileScripting, objFolder 
  6.     Dim filename, filecollection, strDirectoryPath, strUrlPath, newName 
  7.  
  8. strDirectoryPath="c:\inetpub\scripts\" 
  9.         strUrlPath="\scripts\" 
  10.  
  11.         'get file scripting object 
  12.         Set objFileScripting = CreateObject("Scripting.FileSystemObject") 
  13.         'Return folder object 
  14.         Set objFolder = objFileScripting.GetFolder("C:\ASP collection\NYGH\Accolade") 
  15.         'return file collection In folder 
  16.         Set filecollection = objFolder.Files 
  17.         'create the links 
  18.  
  19.                 For Each filename In filecollection 
  20.             Filename=right(Filename,len(Filename)-InStrRev(Filename, "\")) 
  21.             x=len(Filename) 
  22.             newName = left(Filename ,x-4) 
  23.             Response.Write "<A HREF=""" & strUrlPath & filename & """>" & newName & "</A> 
  24.         Next 
  25.  
  26.     %> 
  27.     </BODY> 
  28.     </HTML> 
Thanks in advance
Aug 1 '07 #1
0 2477

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Al Kolff | last post by:
Hi, Has anyone come across a utility to check the case of a filename versus a php page? I develop locally on a windows machine (Know Know) then upload to a Linux and everything works usually works...
7
by: Dave Navarro | last post by:
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...
4
by: Mullin Yu | last post by:
e.g. c:\test doc1.txt doc1.pdf doc2.txt doc2.pdf doc3.txt doc4.pdf doc5.txt doc5.pdf
13
by: Chris Johnson | last post by:
I have what seems to be such a simple thing yet I cannot figure out how to do it. I am using a streamwriter to build a text file. At the end of the process I want to open that same text file in...
5
by: nospam | last post by:
Hi there, I'm using VBScript to display a list of the ten most recently updated pages on my web site. Right now, the script lists the filenames and the date modified in a given directory. ...
3
by: jpabich | last post by:
I want to display a list of filenames that exist in a certain directory. How do I go about loading this list?
10
by: Abubakar | last post by:
Hi all, I'm using stl's list to store some file names. Its declared as: list < char * filenames; i enumerate the list by using: list < char * >::const_iterator filename; filename =...
6
by: eso40043 | last post by:
Hello, I am a newbie at python, as will shortly become painfully apparent. I wrote some code that goes through a list of file names that contain names of stars. I put the star names in...
6
by: kimiraikkonen | last post by:
Hello, I have a listbox and folder browser control. I need to display all .mp3 files' pathes into listbox. It was Ok with openfiledialog but how can list all .mp3 extension- having files into...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.