Is there an API routine for sending the contents of form to a file, or creating that file if it doesn't exist?

Comments

coderintherye’s picture

HTML Export Module: http://drupal.org/project/html_export
or
SavetoFTP Module: http://drupal.org/project/savetoftp

Both modules send a node's content to a file. Depending on what you want to do that may suffice or in the case that it doesn't the code should get you where you want to go.