When I save an Xml with FileReference.save(), the file is downloaded in my computer. The Xml is written in the file but there are additional data at the end like this, so the file is not a valid xml. I’ve tested only on html5.
Sample file :
This is an old problem of FileReference.save() in HTML5. I ran into a situation where I needed to save binary data to a file (level data), and the presence of garbage at the end of the file was critical for me.
For some reason I am currently using openfl 8.9.1 (lime 7.4.0), so the code may not match. In my case, problem resolved by adding string:
file: lime/ui/FileDialog.hx,
function: save,
after: var path = defaultPath != null ? Path.withoutDirectory(defaultPath) : "download" + defaultExtension; var buffer = (data : Bytes).getData();
new string: buffer = buffer.slice(0, (data:Bytes).length);