Method-Draw icon indicating copy to clipboard operation
Method-Draw copied to clipboard

Image Save - SVG

Open cheyennemtnman opened this issue 9 years ago • 6 comments

When using image save... a popup windows displays the SVG... I have to use save SVG only to save file to my device. Is it possible to make adjustments in code to save to device storage the same as open SVG popup?

cheyennemtnman avatar Aug 24 '15 03:08 cheyennemtnman

If I recall correctly there's a way of generating a download from javascript but it only works in Chrome, I'll address this issue.

methodofaction avatar Dec 11 '15 04:12 methodofaction

@duopixel

I guess we can make this work for Safari as well.

  • It involves creating a <a> tag and attaching the file blob on the src, then having the user click on it to trigger the download.

The issue I see here is mostly the UI implementation of the above and if it's really worth it to go that far. I'd happily create a PR for this if you could describe to me a workflow that the user would follow.

nicholaswmin avatar Dec 29 '15 06:12 nicholaswmin

This looks like a good match...

https://github.com/eligrey/FileSaver.js/blob/master/FileSaver.js

I'll give it a try in a while

methodofaction avatar Dec 29 '15 06:12 methodofaction

Used it before,

Takes care of of Firefox/Chrome/IE like a charm.

Safari doesn't play well with it as mentioned here. Since Webkit is the engine behind any browser on iOS, it won't work there as well.

That's where the trick above comes in handy though.

nicholaswmin avatar Dec 29 '15 07:12 nicholaswmin

thanks for the notice @nicholaswmin, I've implemented the download thingy for all browsers except Safari. I'll tackle Safari later.

methodofaction avatar Dec 29 '15 16:12 methodofaction

:+1:

nicholaswmin avatar Dec 29 '15 23:12 nicholaswmin