Is there a way to publish data to a CSV file hosted on a webserver?

Check for example this thread, it uses webhook to send data to PHP script. You will need to replace JSON encoding with creating CVS line in the PHP script. Say your published variable is already CSV line, like:

value1,value2,value3

Then it should be as simple as (part with . "\n" adds newline character after you data so you don't have to send it from particle):

file_put_contents('path/to/file.csv', $_POST['data'] . "\n", FILE_APPEND);
1 Like