diff --git a/lime/ui/FileDialog.hx b/lime/ui/FileDialog.hx index 699d47a91..3d624ae2a 100644 --- a/lime/ui/FileDialog.hx +++ b/lime/ui/FileDialog.hx @@ -274,7 +274,11 @@ class FileDialog { var path = defaultPath != null ? Path.withoutDirectory (defaultPath) : "download" + defaultExtension; var buffer = (data:Bytes).getData (); + #if commonjs + untyped __js__ ("require ('file-saverjs')") (new Blob ([ buffer ], { type: type }), path, true); + #else untyped window.saveAs (new Blob ([ buffer ], { type: type }), path, true); + #end onSave.dispatch (path); return true;