remove garbage from bytes when saving a file on html5, see : https://community.openfl.org/t/problem-with-filereference-save-xml/12776/2

This commit is contained in:
loudoweb
2020-11-23 10:52:46 +01:00
committed by Joshua Granick
parent 8e7ab67745
commit 6ac395a706

View File

@@ -223,6 +223,7 @@ class FileDialog
var path = defaultPath != null ? Path.withoutDirectory(defaultPath) : "download" + defaultExtension;
var buffer = (data : Bytes).getData();
buffer = buffer.slice(0, (data:Bytes).length);
#if commonjs
untyped #if haxe4 js.Syntax.code #else __js__ #end("require ('file-saver')")(new Blob([buffer], {type: type}), path, true);