-1

I am new to HTML. I need to create a webpage that reads system path from user and display the statistics about folders and files in a table format. And i want to do the following things

1) Read for folders under path

2) To access sub folders under folder

3) Read the files under a path

4) To get the path of files (to create hyperlink)

For Example, I need to go to the system path given by user in a webpage and read folders in it. For each folders i have to read subfolders and files in it and create a table that displays the name of subfolders under the parent folder and other information about files

So in addition to html what should i learn to do these things. Thanks in advance.

  • Short answer: you can't. Not only with html and javascript. – DontVoteMeDown May 10 '17 at 11:27
  • 1
    See [http://stackoverflow.com/questions/2376745/does-html5-allow-you-to-interact-with-local-client-files-from-within-a-browser](http://stackoverflow.com/questions/2376745/does-html5-allow-you-to-interact-with-local-client-files-from-within-a-browser) – Irfan434 May 10 '17 at 11:28
  • @DontVoteMeDown i am asking in addition to html what should i learn to achieve these things – Vignesh Karthikeyan May 10 '17 at 11:31
  • Python. It's a really relevant technology, easy to learn, installs easily (your computer may already have it). PHP is another option, but as far as I can see that remains alive because of WordPress. If WordPress abandoned it, PHP might all but vanish. – Tim Consolazio May 10 '17 at 11:39
  • @DontVoteMeDown I need to go to the path given by user and read folders in it. Then inside each folder i need to read folder name, files and display that in a table format in HTML page. – Vignesh Karthikeyan May 10 '17 at 11:42
  • Again, possible with any language that can support a web app (which is just about anything now). But, if you have no idea what things like "web servers" are and how to use one, you may have some skilling up to do. Knowing HTML/JS without knowing anything about servers, these days, is pretty useless. Fortunately, there's a ton of turnkey web server solutions these days. Check out MAMP https://www.mamp.info/en/. It installs everything with a couple of clicks, you can use Python, PHP, etc. Great tutorials, no command line fooling, it's ideal for the beginner. – Tim Consolazio May 10 '17 at 11:45

2 Answers2

2

First of all, HTML is used to define and format the presentation of text, images, and other web content, only. And therefore, in order to handle user input and execute server side commands (like listing directory/sub-directories content), you need to write server side code.

Server side languages allow you to create dynamic web content; in your case, code that would:

  1. process the user input,
  2. execute server side command to list system files,
  3. and generate the tables and their content from the return result of the executed command.

php is straightforward easy-to-begin-with language. You can find a basic introduction to php on W3Schools. PHP 5 Tutorial - W3Schools

If you choose to go for php, check the following php function scandir. This php built-in function allow you to list files and directories inside a specified path.

JadMokdad
  • 21
  • 3
0

Nodewebkit or Electron both can give you ability to write HTML/CSS/Javascript that will be executed in client machine with access to users filesystem. Check them and see if they fit your scenario.

In short, you will have to compile your HTML/CSS/Javascript as a standalone executable file (various Operating systems are supported) and provide that executable to the client so he/she can run it.

Amiga500
  • 5,874
  • 10
  • 64
  • 117