1

Please tell me how to get computer's home directory path in AngularJS or JavaScript.

Such as C:\Users\<username>.

halfer
  • 19,824
  • 17
  • 99
  • 186
cheeku
  • 57
  • 1
  • 10

3 Answers3

4

Short answer - you can't.

Slightly longer answer:

It would be a terrible security issue to allow a website unfettered access to the local computer file system. Given user interaction, there are a few options.

This is an excellent tutorial showing what you can do: https://www.html5rocks.com/en/tutorials/file/dndfiles/

ste-fu
  • 6,879
  • 3
  • 27
  • 46
2

I don't think it's possible to get user's home directory in javascript for security reasons.

Rashmirathi
  • 1,744
  • 12
  • 10
0

If you want to save some data try to use Web Sql to use local storage. If you need data that is not generated by your webapp, you need your user interaction to upload the data the he/she wants to use in your app.

Try to use drag and drop to make it easier for your user.

That is all you can do with web applications from a browser.

But you can do more with phonegap or electron.atom.io if it can be served from outside of a browser.

Botond Bertalan
  • 370
  • 2
  • 8