Saving bpmn and svg to a website rather than download

Hello, I love bpmn.io, I am integrating it into WordPress and like to save the model (bpmn and svg) in the server via ajax call, where is the logic to control the file download? I searched the index.js file and couldn’t find it anywhere?

Thanks
Ralph

Checkout the modeler example that provides a download button. Instead of downloading you can simply push it up to a REST back-end or the like.

Thanks Nikku,
My question was how the download button work. It seems that it stores the contents of the xml in href tag.

Is there an API documentation for Renderer class?

Thanks very much.

No API documentation as of yet. We are going to set one up in the future.

I use this:

function saveSVG(done) {
  renderer.saveSVG(done);
}

function saveDiagram(done) {

  renderer.saveXML({ format: true }, function(err, xml) {
    done(err, xml);
  });
}

saveSVG(function(err, xml){
    	//do some ajax thing
});

saveDiagram(function(err, xml){
    	//do some ajax thing
});