473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 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 2490

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
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.