Base 64 Decode To File
Table of Contents
The zoho.encryption.base64DecodeToFile task is used to decode text that is encoded in base 64 format, and convert the decoded content to a file.
<response> = zoho.encryption.base64DecodeToFile(<encoded_text>,<file_name>);
Specifies the response that represents the file object that contains the decoded data
Specifies the base 64 encoded text that needs to be decoded
Specifies the name of the file that needs to be created
The following script decodes the base 64 encoded text - U3Vuc2hpbmU= and converts it to a file with name - Sample File.
response = zoho.encryption.base64DecodeToFile("U3Vuc2hpbmU=","Sample File");
The following script encodes a file fetched from the web and decodes it back to restore the original content as a file object.
//Fetch a file from the web using invokeUrl task sample_file = invokeUrl [ url: "http://www.africau.edu/images/default/sample.pdf" type: GET ]; //Encode the file content text_to_decode = zoho.encryption.base64Encode(sample_file); //Decode the encoded content and restore it back to a file response = zoho.encryption.base64DecodeToFile(text_to_decode,"Sample File");