How to download image to desktop with OS.File

You stole half that from my solution here: https://stackoverflow.com/a/25112976/3791822

And the other half from @nmaier’s solution here: https://stackoverflow.com/a/25148685/3791822

Very nice 😉

Haha anyways you are real close. You got the ArrayBuffer but pass it as Uint8Array so:

var promised = OS.File.writeAtomic(file, new Uint8Array(data));

I don’t know if this is the best way to download it. But it looks almost 100% async. Maybe it is the best way. Real cool man!

Leave a Comment