Sort List Of Files In Directory
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.
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.
Im using the following code to display the contents of a directory:
<%
Set objFso = CreateObject("Scripting.FileSystemObject")
Set objFiles = objFso.GetFolder(Server.MapPath("."))
Set fileList = objFiles.Files
For Each i in fileList
response.write i.name & " - " & i.DateCreated & "<br>"
next
%>
Is there a way I can sort this by Date Created so the most recent files are
on top?
I have a directory called 'imagefiles' that contains upto 50 images - the images are named 01.jpg, 02.jpg, 03.jpg etc, etc. What I want is a single ASP page (displayimages.asp) that will display each image with a Next and Previous button to move back and forth between each image. I know how to list the contents of a directory using the FSO object and I know the URL behind the Next/Previous button could be something like displayimages.asp?image=01.jpg to determine what image needs to be displayed. What I'm getting hung up on is how to construct the URL i.e. when the displayimages.asp file is first displayed there simply needs to be a Next button and the URL will need to be something like displayimages.asp?image=02.jpg. Then when the visitor clicks the Next button the next page will need both a Next & Previous button - the URL behind the Previous button will need to be displayimages.asp?image=01.jpg and the URL behind the NExt button will need to be displayimages.asp?image=03.jpg...but how do I get the 02.jpg, 01.jpg, 03.jpg values to form part of the URL for the image variable?? Hope you see what I mean.....oh and I don't want to use a database to hold the image file names.
View Replies View RelatedHow would I list all the files in a directory and hyperlink to relevant document. For eg.
If user has a webpage with two folders displayed on the screen i.e. webpage or threads. User should be able to chose one of the folder in this case the user clicks on the webpage folder and list of different files in that folder appears on a separate window.
The list of files should contain different file attributes such as CREATED ON ,DATE .Once the user clicks on the file the hyperlink should take the user to the relevant document.
I attached two sample image files that user must be able to view it on their screen . When the user clicks on the first image the second screen should pop up on the screen..
How can I list all files of a directory with fso or wsh and afterwards write its names on screen?
View Replies View RelatedI'm looking for a free ftp component so that I can list files from an ftp directory. I have found majodio.ftp ,but it costs and I was wondering if there was a free version anyone knew about.
View Replies View RelatedI have files in a folder that I am using the FileSystemObject to read. I can read the files and display links to them no problem, what I want to do is to sort them by date created.What is the best way to go about this?
View Replies View Relatedis there an easy way of viewing the files in a directory without using "server.MapPath"!!!
i need to view Doc files in a folder and then open them in IExplorer to print the matter in them...
I have been given a asp legacy application, on each code file they have included some files which are located in the web directory they are,
<!-- #include virtual="/dss/includes/header.inc"-->
<!-- #include virtual="/dss/includes/classes/user.inc"-->
<!-- #include virtual="/dss/includes/classes/menulist.inc"-->
But i tried to find these files in the directory and couldn't locate them (tried searching them too, no result). My application runs perfectly fine,
Any idea how this thing works and where the files actually located.
I wanted to loop through a directory and get the names of all the files in the directory and put it in a table using the file system object and VB scrip in a DTS package.
View Replies View RelatedI understand how to delete files within a directory using the Scripting.FileSystemObject.
However, how can I delete a directory using ASP 2.0 on an older IIS 4.0 server? Do I need to:
1. Delete all the files within the directory.
2. Change the directory's permissions.
3. Delete the directory.
Am I able to delete a directory without changing the permissions? Can I delete a directory with files inside the directory or does the directory need to be empty?
I am wanting to delete all files contained in a directory.
I won't have the name of the file...
Can i do this somehow??
Is it possible to develop an ASP page to search within an intranet environment. The file properties searched out and then post the properties info to an access dataset ?
I had searched for commercial shareware and other searched out items only to find applications where I can get file name, created dates file sizes. Nothing more nor expandable for additional information. And then put into a spread sheet. One did work but only on minimal property info. I need to expand to more information from the properties of specific files.
Example I used was morespace, Located all files in a specific drive, folder or etc then listed a few items into a table. I need the same ability but the capability to add and change how much information I can record from the file properties.
IIS cannot read files in a directory reporting that :
Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method: 'Fso.GetFolder'
This has to do with Scripting.FileSystemObject.
I make sure the scrrun.dll is properly registered with regsvr32.
Still the problem persists.
Previously I do not know what I did right once in permission setting and
managed to display the said files but it went away after tweaking the
permission for make other functions available.
I scoured the web and this problem is a perrenial one. Many many suggestions
have been made even in expertsexchange site but no real solution. I don't
understand why it is so difficult to have this file system service up and
running.
i'm having problems trying to find information on how to write an asp
script that lists the files in a directoy
what i am looking to do is just list the 5 most recent files and list
them in descending order (newest) first
can anyone help me out here with a link, or some basic instructions,
i've found plenty of scripts that list files, but they don't explain
how its accomplished, and to me that's more important than simply
dumping a script on the server and using it
I'm trying to include and calling some ASP files from different directory. It doesn't work.
I need to use <A HREF>tag to link the ASP file and image file using <img src>tag. I entered the whole http://mydomain.com/....... path inside of tag. It doesn't work.
For example.
The original web page is reside in c:webrootwebpageestpagehomepage.asp
All the image files and other ASP files are reside in:
c:webrootwebpageaspfile.asp
c:webrootwebpageimagefile.jpg
In the IE browser, the link would go to
http://www.mydomain.com/webroot/webpage/testpage/aspfile.asp
Of course, it won't work because the aspfile.asp is reside in webrootwebpage, NOT in webrootwebpage estpage diretory.
point me to some example code of searching for a file, like *.*, or *.pdf, much like the Windows search function. I am at a smaller location, away from the main office, and although I can map a drive or just use to go to the desired location, the connection is too slow to search.
I'd like to implement a search function on the intranet web (at the main office), where it will search a certain directory and its subdirectories and return the results as network links (using the convention); actually it doesn't matter how it displays the links, as long as it shows me where stuff is. That way the search is run on the computer where the originating directories are.
I know how i can list and manage files (with the file object) on a normal directory with ASP. But i couldn't find any information on how do i list/work with files which are locaed on a password protected directory (with basick auth). how to make such a task ?
View Replies View RelatedI'm trying to run each file in a directory to be put into an include file line
I can't get anything to work me. Code:
I have a client who has a password protected page (via session) that lists a bunch of pdf's. They are a little worried that you are able to browse and see the pdf's via the url without being logged in.
I'm not sure if it's possible or not but is there a way after their username and passord is verified to automatically grant them permisson to view the contents of the pdf directory?
I want to create a webpage which will list all the files in particular
folder and hyperlink to them to allow users to view the grpahics online
without having to send each file to them by email.
I got the following code but gives me a VBScript error. I have created a
folder called files under the home directory of this website and have added
the name of the folder
<%@ LANGUAGE=VBScript %>
<%
Dim ofs,of
Dim fi
set ofs = createobject("Scripting.FileSystemObject")
set of = ofs.getFolder("files") ' blieve this is the problem
For Each fi In of
Response.Write("<a href='" + fi.Name + "'>" + fi.Name + "<br>")
Next fi
%>
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/default.asp, line 13
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 site): Code:
View Replies View RelatedHow can I make and populate list menu with name of files from one folder and then select one of their?
View Replies View RelatedDoes anyone knows how to list all files with a given folder?
View Replies View RelatedI'm using server.mappath to list a directory's contents. The code works fine, but the owner wants to know if there's a way to display the list by the date the file was posted, instead of the alpha order that it is presented by? I haven't been able to find an answer.
Here's what I'm using:
I have written a script to update user information in the Active Directory using ADSI. Here is part of it:
Set User = GetObject("LDAP://<GUID=" & GUID & ">")
User.Department = DepartmentName
User.SetInfo
Set User = Nothing
This works fine unless DepartmentName is an empty string ("").
Then I get error 0x8007200B: "The attribute syntax specified to the directory service is invalid."
This happens with all the attributes I have tried, including TelephoneNumber
.
Do I need to delete the value of the attribute instead of setting it to an empty string? If so, how do I do it?
How can i list out all the email address into my website from the hotmail caontact list? i am successful log in into the yahoo contact list by using serverxmlhttp and list out all the email address from the page source, but i could not access to hotmail by using the serverxmlhttp. Is any other methos can list out the email address from hotmail contact list?
View Replies View RelatedI have a script that I want to display the returned list numerically in. The database is deciding how to order the list, and is being displayed pretty loosely. Is there anyway I can sort the returned list numerically here? Code:
View Replies View RelatedI have a database table, that I need to sort by PART of the contents of a field (named rFieldName in the table):sample contents of this field are:Code:
qid_5_question_1
qid_12_question_5_0_1
qid_12_question_5_0_2
qid_12_question_5_1_1
qid_12_question_5_1_2
qid_12_question_5_2_1
qid_12_question_5_2_2
qid_12_question_5_3_1
qid_12_question_5_3_2
qid_6_question_2I need to sort his field by the value that appears AFTER the 3rd underscore, and if applicable BEFORE the 4th underscore
Is this possible - can you help please - I have no idea where to start on this as I've never had to try to do something like this before.
I have a JS/ASP application that sorts a SQL populated table.
This works great, and sorts the data fine, apart from my currency columns.
It wants to read the data as text as far as i can gather. Ths data in ASP
looks like this -
<% =formatcurrency(RS("income"),2)%>
I have tried changing this to a number (formatnumber) and hard coding a £
sign, yet it still wants to read the data as text, rather than numerical?
How can i get my JS function to read currency or if not, eliminate the
forehand figures. I need the data to appear as a currency, yet be sorted as
a number (rather than taking the 2st digit)if this is a
common problem (sorting currency) and there was a universal solution around
this
I've lurked on here for awhile but I've come upon something I'm having trouble with.
I have a database table of movie titles and I want to sort by the column, but ignore the articles in the title, "a", "an" or "the"... "The Lion King" would be under L... "A Bronx Tale" would be listed under "B", etc.
Does anyone have a function that does this or know of another method? Or am I forced to enter them as "Lion King, The", for example?
Which would be faster?
1) Bubble sort
2) Join Array remove empty delimaters and then Split.
I am thinking the second would be a faster routine wouldn't it?
I have a form that is created dynamically, and all is working fine. But I want users to add an sort order to help list phrases in a certain order.
<input type="text" name="AdvantSort" value="" size=1>
<input type="checkbox" name="Advantages" value="10">
Phrase1
<input type="text" name="AdvantSort" value="" size=1>
<input type="checkbox" name="Advantages" value="20">
Phrase2
so on, so forth...
And one clicks on the form, and a SQL statement is executed.
However, when I create the SQL statement,
INSERT INTO table1
(FormId,AdvantageId,SortOrder)
VALUES (<call from form ID>,<advantages>,<advantsort>)
Then it loops to allow the next phrase to be entered. The statement also takes the value from every other sort order value including that ones that are in different lines. Which in result, gives me an error, saying the insert columns exceed that of the available columns in the table.