473,326 Members | 2,805 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,326 software developers and data experts.

Sort list of files in directory

Hello,

I'm beginning in the ASP world...

I would like to sort (descending) list of files in directory.

Parameter is directory url.

How I can to do that with ASP not ASP.NET.

Thank you very much.

Jean-Paul
Jul 19 '05 #1
2 14231
On Tue, 23 Dec 2003 21:16:40 +0100, "Jean-Paul Lauque"
<je**************@wanadoo.fr> wrote:
Hello,

I'm beginning in the ASP world...

I would like to sort (descending) list of files in directory.

Parameter is directory url.


Use the File System Object to retrieve the files collection.
Something like:

==============
' Get the folder needed from a query string
' could be Request.Form or whatever

Folder = Request.QueryString("Folder")

' Use the FSO to get the files collection

Set FileSystem = CreateObject("Scripting.FileSystemObject")
Set DisplayFolder = FileSystem.GetFolder(server.mappath(Folder))
Set DisplayFiles = DisplayFolder.Files

' Display each file on a line in a web page

For Each FileName in Files
response.write FileName.Name & "<br>" & VbCrLf
Next
==============

The files are already sorted descending order, but you could load them
into an array and sort to your heart's content if you wish.

Jeff
Jul 19 '05 #2
And here are some related links:

Directory List (Sorted)
http://www.asp101.com/samples/dir_list_sort.asp
Puts file info into an ADO recordset and then sorts that.

How do I sort a file list alphabetically? - 7/16/2000
http://www.aspfaq.com/show.asp?id=2025

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mike Zupan | last post by:
I have a list that includes files and directories ie: list = I want to sort it so it looks like this I'm just wondering if there is an easy way to do this
3
by: Mary Jane Pronio | last post by:
What I want to do is take that output, use the data within it to put into a shell script as input to another installation of DB2 Connect on another AIX box. Any ideas about how to do this?
8
by: RML | last post by:
hey guys, i am looking at this piece of code that lists numbers of files in a directory. i want to convert it so it lists the files in th directory that end with .doc. i cant seem to get it to...
0
by: Don | last post by:
I intermittently get a runtime Compilation Error that says 'The compiler failed with error code 2000'. It appears that a DLL cannot be found in the 'temporary asp.net files' directory. The...
1
by: Shawn Mehaffie | last post by:
I have an application I want to be able to: 1) Store user specifc settings in ther "My Documents". 2) Store some information in "All Users" document directory. 3) I also want to be able to...
1
by: dcruncher4 | last post by:
DB2 8.2.3 is there a sql equivalent to get the information provided by db2 list node directory db2 list db directory. thanks.
1
by: mmohanra | last post by:
I am trying to list files in a folder in a remote server. I am using Scripting.FileSystemObject. This seems to be really slow. After a long time the connection times out. Is there any other way to...
3
by: froditus | last post by:
Hello everyone, is it possible to list files from directory other than in apache web directory? my web folder is placed on c:/ and i put my files in windows directory "d:/files/images/". I...
5
by: jr | last post by:
I created a simple class, have used it to populate a list (of myclass) - The class only contains a customer id and a date. I would like to sort this list based on most recent date to the oldest....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.