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:
8
extras/server-save/README
Normal file
8
extras/server-save/README
Normal 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
|
||||
3
extras/server-save/svg-editor-save.js
Normal file
3
extras/server-save/svg-editor-save.js
Normal file
@@ -0,0 +1,3 @@
|
||||
this.saveHandler = function(svg) {
|
||||
$.post("svg-editor-save.php", { svg_data: escape(svg) } );
|
||||
});
|
||||
8
extras/server-save/svg-editor-save.php
Normal file
8
extras/server-save/svg-editor-save.php
Normal 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);
|
||||
?>
|
||||
Reference in New Issue
Block a user