1,105,290 Community Members

Directory Listing

Member Avatar
xyciana
Newbie Poster
7 posts since May 2009
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Sponsor
 
0
 

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

Member Avatar
ShawnCplus
Code Monkey
1,564 posts since Apr 2005
Reputation Points: 456 [?]
Q&As Helped to Solve: 269 [?]
Skill Endorsements: 39 [?]
Team Colleague
 
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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article