Read and write to JSON

blogsit3

New Member
Messages
1
Reaction score
0
Points
1
I have an angular 2 project, how can I read and write to a JSON file on my server?

I can do what I want within my code itself bit I don't want to have to change my code, recompile and upload my website every time.

Any help?
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Not as such, no. Well, you can read JSON, of course, but directly writing to a file from the "front end" isn't possible and uploading JSON for a PHP page to write to file is going to run into 403 errors. You can upload a similarly-structured bit of text that can be transformed to JSON server-side; key/value stuff doesn't have to look like executable/eval code.

That said, what is "compile" in this context? JSON doesn't need to be compiled (except insofar as a JavaScript engine may decide to JIT it before running it). You're editing text and uploading it. Why is that harder in cPanel's file manager than it is on your own site's front end?
 
Top