What’s a good and simple way to write a string to a file on a server? I know it is somewhat server dependent, but I’d like to know how others do it before I dive into server side considerations. (I have access to both AWS and a more traditional server).
FTP doesn’t lend itself well to appending to an existing file.
I’m thinking that I’ll need to send the data as the body or data of an https transaction, probably as JSON, and in the server end set things up to take the data and append it.
Success, wrote (2022-09-29T19:48:24-07:00 my_name string-that-is-logged Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15 ) to file (test-results.txt)
Note: There's no safety/security considerations here. Malicious actors could write long strings or malformed strings, and could cause problems for your server, take it over, and wreak havoc.