Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to allow save-to-server not working #1

Open
zeigerpuppy opened this issue Apr 3, 2016 · 0 comments
Open

Changes to allow save-to-server not working #1

zeigerpuppy opened this issue Apr 3, 2016 · 0 comments

Comments

@zeigerpuppy
Copy link
Owner

The following changes were made as suggested here: http://binoyav.blogspot.com.au/2011/11/svg-edit-saving-files-to-server.html

To see latest build, go here: https://research.greenant.net/Sandstorm-Method-Draw/method-draw/index.html

It looks like those changes actually don't do what I though they did, they save to the client machine, not the server!

Here's what we tried anyway:

  1. Open svg-editor.js

In curConfig object, to the extensions array add 'ext-server_opensave.js' to the end. Make sure that ext-server_opensave.js , fileopen.php and filesave.php exist in the svg/extensions directory

To save the file to server

Do these steps.

Open the extensions/filesave.php and comment out below code

header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=" . $file);
header("Content-Type: " . $mime);
header("Content-Transfer-Encoding: binary");
echo $contents;

And add the following code at the end

define('DIR_PATH', 'path to the directory with trailing slash');
$fp = fopen(DIR_PATH . $file, 'w+');
fwrite($fp, $contents);
fclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant