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.


, , , Sid 4 years 2020-02-26T08:38:23-05:00 0 Answers 66 views 0

Leave an answer