WordPress: How to write to a text file and save it in a folder for later download?
I’ve a template file in the ‘templates’ folder that performs a function based on the JSON input it receives from an external source.
I want to write that JSON input in a text file and save it somewhere. And then later can access it through another page via browser URL hit.
My problem is that I don’t know where this text file should be stored and I’m sceptical about how safe this approach is. Note: This is not a plugin, it’s just a template php file that does something when loaded in the browser URL.