Is there a way to allow a user, after he has created a vector graph on a javascript svg canvas using a browser, to download this file to their local filesystem?
SVG is a total new field for me so please be patient if my wording is not accurate.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It might be possible using the regular “Save” browser command, but it won’t just save the SVG canvas, it will save the whole page.
I believe your best bet is to use AJAX and send the whole SVG XML data as POST data to a server script, and have that script just send back the POST data with the header
Content-Disposition: attachment; filename=yourfile.svg.(Under PHP, you can get the raw POST contents with
file_get_contents('php://input').)