We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,201 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Directory Listing

Can anyone help me and provide a way to list files in a directory using javascript. This is on the server (NOT CLIENT). For our purposes we have built a simple search facility (that all we need) and the code takes data from an array. All we want to do is traverse the HTML files, open each one and take out the key words to put into an array.

I have searched google to no avail. Some articles say this can be done but don't provide examples and some articles say it cannot be done. A cross browser simple example would be nice.

Help appreciated in advance

2
Contributors
1
Reply
11 Hours
Discussion Span
3 Years Ago
Last Updated
2
Views
xyciana
Newbie Poster
2 posts since May 2009
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Nope, you have to use a server-side language. Javascript lives in the browser so it can't directly touch either your server or your client's machine. You can have Javascript make a request to the server which provides a listing but Javascript itself can't.

ShawnCplus
Code Monkey
Team Colleague
1,583 posts since Apr 2005
Reputation Points: 526
Solved Threads: 269
Skill Endorsements: 26

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0653 seconds using 2.66MB