Download file Txt

I need help!

I have an API to download a file, when I make the request through Insomnia it shows me the structure of the file, but when I run it through Retool it returns a base64.

In this case, what I want is that when I make the request through Retool, the file is downloaded in a Txt, recording all the information contained in the request return there.


Hello @Wilson

I think maybe you could run functions in JS to rotate and manipulate this base64 and save in another format.

http://www.java2s.com/example/android/file-input-output/save-base64-string-to-file.html

https://github.com/search?o=desc&q=decode+base+txt&s=stars&type=Repositories

Hi @Wilson,

Can't you use the native download/export utility function of Retool for this?

utils.downloadFile({ base64Binary: result }, filename, "txt");

You can run a JS Query to access this native function.

1 Like