Serialize to XML without php requirements


I’m playing around with a “home automation package” based on C# as the backend server and utilizes a web browser for the display ana management of the app. The server contains its own “web server” to receive requests from the client. Its pretty simple in the sence that it is able to run via mono and also on embedded devices such as Raspberry PI device. (

The web client is comprised of simple html pages and utilizes jquery for the front-end display logic.

my question is, as i’m not a programmer by profession, i’mgoing to use an xml file to hold the scheduling info and the server part will read it and turn the lights on/off when scheduled.

The serialize to XML sample calls a php function to save the file, as the app has its own mini web server, i’m assuming it will not run php, so is there any other way to easily save the contents back to the server – is there a C#, or simple html way to save the file either within the scheduler product or a 2rd party module that can be utilized to get the xml data back to ther server.

any help or insight appreciated.



We are looking at the following sample, right?

If so please note that XML itself is generated on client side. We often were asked how user can download that data. And the easiest way - to send it the server script which would simply echo it back - and browser will prompt to Save the file.

var form = document.forms[0]; form.action = "./data/xml_download.php"; = scheduler.toXML(); // now we have all our data as XML string form.submit();
What can you do once you got the data?

  • save it to the local storage if your browser supports it (it really should)
  • send it to your own server-side script which would simply get the POST value and save it to the file

Kind regards,