File management

Hello everyone,
I work on a hosted database that contains files in JSON format with the file name type and base64 decode i want to download those files and also be able to upload those files to the database.
I created a resource query to interact with the database at some point I was able to download the uploaded files but the content of the file was damaged when I uploaded, i also created a rest API to interact with the database but still wasn't able to download the file as it is a response form that API that contains the same JSON object.
If there is any way to achieve this I'm really pleased to hear it .