0

Is it possible to push data to a local json file stored in my app folder using the $http service?

I've tried fiddling around with $http.post/.get and can't find a way to save/push new data into my local .json file.

4
  • What server implementation are you using? Commented Jun 4, 2014 at 0:02
  • possible duplicate of How to push an object into local .json in Angular? Commented Jun 4, 2014 at 0:04
  • Server implementation? None, I'm not hooking up a backend or anything. The .json is in a local folder 'polls/polls.json' where the index.html file. Is there anyway to push data there? Or does it have to be a remote service? Commented Jun 4, 2014 at 0:17
  • There's no easy way to write to a file system from a browser. It would be a MAJOR security flaw. Commented Jun 4, 2014 at 0:24

1 Answer 1

3

Javascript is a client side program and therefore has no ability to modify files on your server (if you're just playing with directories on your local machine, for all intents and purposes, the local machine is your server.) Its only concern is client side logic. You need some type of server backend to do this.

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

1 Comment

Thanks, I'll give firebase a try.

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.