1

Is there a way for an html document using Javascript to read the file names of the current and sub directories?

I understand that for security reasons this may be a restricted functionality, but im looking not using this as a served application - rather locally residing HTML files in each directory to log the contents. Looking at the following scenerio...

We have a directory tree structure with multiple sub directories, each with hundreds of files (logically named) - and we maintain logs for these files in xls format. If i could have an HTML file in these directories using javascrpipt, i could dynamically create this logs rather than manually maintaining them.

thanks...

9
  • 5
    The force will never be with you in this case. Commented Mar 26, 2015 at 14:31
  • You can't do this with HTML and JavaScript alone. If you used PHP with JavaScript it would be possible. Commented Mar 26, 2015 at 14:32
  • Yes, easy to do with PHP - but this is not a web server environment. This is a local file server environment - im trying to think outside the box a little and use HTML/Javascript to automate a relatively tedious task. I feel like i should be able to use HTML and Javascript for "other than web development" purposes. Commented Mar 26, 2015 at 14:35
  • 1
    And i up voted Amits response for the laughter - much needed. Commented Mar 26, 2015 at 14:36
  • You need a server side application to dynamically get the path of current and sub directories. To simplify, one usually uses a template mechanism that you may find or build by yourself with any server side application language you wish to use. Commented Mar 26, 2015 at 14:37

1 Answer 1

1

Here is a good example of how you can do that and don't die trying: http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.