put server-save into "extras"

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@47 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Pavol Rusnak
2009-06-06 23:54:53 +00:00
parent 35e68a1dd5
commit 8a55732a30
8 changed files with 27 additions and 43 deletions

View File

@@ -0,0 +1,8 @@
Usage:
1) copy file svg-editor-save.php into the directory
2) edit the end of the svgcanvas.js and change this.saveHandler method
into the method described in svg-editor-save.js
3) now the drawings will be saved into the file named saved.svg

View File

@@ -0,0 +1,3 @@
this.saveHandler = function(svg) {
$.post("svg-editor-save.php", { svg_data: escape(svg) } );
});

View File

@@ -0,0 +1,8 @@
<?php
$svg = $_REQUEST["svg_data"];
$svg_data = urldecode($svg);
$file = "saved.svg";
$fh = fopen($file, "w") or die("Can't open file");
fwrite($fh, $svg_data);
fclose($fh);
?>