0

I have certain html forms. On-submit it has to generate new text/json file (name to be saved based upon one of the field in form) in the local drive with the contents filled in the form. Is this possible in angularjs? As well as to retrieve the data based upon the file name.

Akshaya
  • 115
  • 1
  • 7
  • Why would you want to save the information to the users HDD, would you not want to send it back to the server for processing? You can send it back to the server and have the server respond with a file, in which case the user saves it to the HDD – Callum Linington Feb 29 '16 at 08:24
  • I want to do this without any webserver. – Akshaya Feb 29 '16 at 08:26
  • Possible duplicate of [Writing a json object to a text file in javascript](http://stackoverflow.com/questions/22055598/writing-a-json-object-to-a-text-file-in-javascript) – Martijn Welker Feb 29 '16 at 08:28

2 Answers2

1

Spontanously, I wouldn't want a javascript based web page to access my hard disk drive. That seems like a security risk for me.

Could local storage be an alternative for your use case?

Read more about local storage and angular js: http://www.amitavroy.com/justread/content/articles/html5-local-storage-angular-js

prograde
  • 2,620
  • 2
  • 23
  • 32
0

You can use filesystem API but it is chrome specific.

Check this Exploring the FileSystem APIs

Shankar Gurav
  • 1,057
  • 9
  • 17