getPDFDocumentFromBase64
Uploads the contents of a file encoded using the Base64 scheme to the file upload location using a specified file name.
Syntax
function getPDFDocumentFromBase64(fileName: string, base64Contents: string): string
| Parameter | Description |
|---|---|
fileName
|
Name of the saved file, including the file extension. NOTE Supported file extensions are defined in the FileUploadWhiteList key in the Configuration Manager. |
base64Contents
|
File contents encoded using the Base64 scheme. |
Return Value
Returns a string containing the saved file's real name.
Examples
In this example:
- We extract the Base64 encoded contents of the the Contract_60c49fa3-e1f2-4ff8-bdfb-56c433e33ebf.docx file. For details, see downloadFile.
- We save the contents under a new file called Contract_copy.docx.
- We save the real name of the copy file in a variable called message.
- We display the message variable on screen. For details on how to display messages, see setMessage.
var message = getPDFDocumentFromBase64('Contract_copy.docx', downloadFile('Contract_60c49fa3-e1f2-4ff8-bdfb-56c433e33ebf.docx'));
setMessage(message);