Support Topics Documentation Slack YouTube Blog

How to access the content of text file stored in files API

  Hi, I receive from the client side a base64-encoded string and I store it in a .txt file in the files api ,is there any way to get the content of this text file using javascript .

Thanks in advance.
var data=car.picture;
const FileURL=“”;
Backendless.Files.saveFile( ‘testfolder’, ‘car.txt’, data, true );
return car;


you can use atob function, please read more here about Base64 encoding & decoding in JS.


we have been trying for couple of days to solve this problem, unfortunately nothing worked. Regarding the solution you’ve mentioned above, we get “message”: atob is not defined"
we tried to import relevant library, still didn’t work. Mark Piller gave us the same solution aswell. My teammate has tried many approaches (Window, WindowBase64, scope) all of them gave “undefined” message, he even tried somehow to copy the content of atob function to the backendless code.
thank you for your time, we appreciate your quick responses and effort.

best regards,
PickApp team

Which environment do you use for your app? Is it browser, node or smth else?

we’re trying to do that in backendless functions. javascript API services

and we’re invoking the function through the browser


If you’re trying to get ‘atob’ propery in your app’s BL/API SERVICES page, you can’t do it. Logic is invoked not in the browser side, so window doesn’t exist. Like it was said here

your task can be done, f.e., in NodeJS. Try to use Buffer class

Buffer.from(content, 'base64').toString('utf8');


we’re aware of the difference between nodejs and frontend js now, websites are full of frontend js and this led us to confusion.
Thanks for helping.