Forum Discussion
SimonH
3 years agoQrew Cadet
You need to decode the base64 into a byte string and write it to a file i am not sure what language you are using but in python it would look something like this
------------------------------
Simon H
------------------------------
dl_file = //get you file from quickbase
//assuming the file is a png image
import base64
with open("img.png", "wb") as fh:
fh.write(base64.decodebytes(dl_file))
​
------------------------------
Simon H
------------------------------
- HemanthH_3 years agoQrew MemberI am using PowerShell. The file is a AES KEY, used to encrypt confidential data. When I convert from Base64, it seems to be adding some extra characters at the beginning.
Is there a way to download the file itself, rather than getting the data in Base64 format ?
------------------------------
Hemanth H.
------------------------------- SimonH3 years agoQrew CadetYou are downloading the file itself, however it is base64 encoded.
Are you simply decoding it and reading it in to your script?
keep i mind that it is not base64 encoded TEXT which can simply be decoded and read as is
it is a file which means there is other metadata encoded in there as well.
You might be doing this
https://base64.guru/converter/decode/text
When you should be doing this
https://base64.guru/converter/decode/file
I have a working python solution but i am not familiar with poweshell. you can try the solution found here to write to a file
https://stackoverflow.com/questions/35334928/convert-base64-string-to-file
and then open the file to ensure it matches exactly.
------------------------------
Simon H
------------------------------
Related Content
- 3 months ago
- 10 months ago