How can one set the extension of the file after it has been decoded by Base64Decoder?

0
Hi Experts! I have a scenerio, I have converted a uploaded file attachment from binary to readable format using the Base64DecodeToFile and downloaded the same using the default file manager. But the file which is downloaded is not reading the extension of the file and is getting downloaded as some general format.  For example: If the uploaded file was an excel, then after the binary conversion it should be downloaded in an excel format only. Not in any general format.    Any suggestion would be helpful! Thanks and regards, Simran.    
asked
2 answers
0

Would need to test it, but I think the binary file contains information about the type of file. If you convert to a string (part of the community commons market place module) and then look for it (using substring and contains logic). I will try to look into this tomorrow and update the answer (if required because no-one else gave an answer).

answered
0

You can check out these Market place modules:

Mime Type checker (recently added)

File Type checker (has not been updated since 2019)

You would then need to create some logic to update the filename with the correct extension

answered