File System - Base64 encode/decode

Declaration

<AMFILESYSTEM ACTIVITY="file_encryption_base64" SOURCE="text" DEST="text" OVERWRITE="YES/NO" ACTION="text (options)" ENCODING="text (options)" />

Related Topics    

Description

Encodes a file to or decodes a file from the Base64 file format using the specified encoding scheme.

Practical Usage

See Description.

Parameters

General

Property Type Required Default Markup Description
Encode/Decode Text (options) Yes Encode ACTION="decode" Specifies the encoding or decoding action to take on the file. The available options are:
  • Encode (default) - Encodes the Source file to a BASE64 format, specified in the Encoding parameter.

  • Decode - Decodes the Source file from a BASE64 format using the encoding scheme specified in the Encoding parameter.

Source Text Yes (Empty)
  • SOURCE="c:\folder\file.txt"
  • SOURCE="c:\folder\*.txt"
  • SOURCE="c:\folder1\|c:\folder2"
  • SOURCE="c:\folder\subfolder"
The path and filename of the file to encode or decode. This can be a fully qualified path and file name (preferred) or a single file (requires use of the File System - Change folder activity). Wildcard characters (for example, * or ?) may be used to specify all files matching a certain mask. Multiple files and/or file masks can be specified by separating each entry with a pipe character (|) (for example, c:\temp\*.txt|c:\backup\*.bak). See File Masks & Wildcards for more details.
Destination Text Yes (Empty)
  • DEST="c:\destfolder\file.txt"
  • DEST="c:\destfolder\*.txt"
  • DEST="c:\destfolder\*.*"
  • DEST="c:\destfolder"
The destination folder (and optionally, file name) of where to save the encoded or decoded file. This can be a fully qualified path or folder/file name only. Folders that do not exist are automatically created at runtime.
Overwrite if file already exists Yes/No No No OVERWRITE="YES" If set to selected, existing files with matching names in the Destination folder are overwritten. If disabled (default), files with matching names are not overwritten, however, an error will occur during runtime stating a file with the same name already exists.
Encoding Text (Options) No Default
  • ENCODING="ascii"
  • ENCODING="unicode"
  • ENCODING="utf32"
  • ENCODING="utf7"
The encoding scheme to use to encode or decode the Source file. The available options are:
  • ASCII
  • Unicode
  • UTF32
  • UTF7
  • UTF8 (default)

Description

Error Causes

On Error

Example

NOTE:
  • The sample AML code below can be copied and pasted directly into the Steps Panel of the Task Builder.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample task encodes a file to the Base64 file format using the ASCII scheme and then saves it under a new file name.

Copy
<AMFILESYSTEM ACTIVITY="file_encryption_base64" SOURCE="C:\temp\file.txt" DEST="C:\temp\decoded.txt" OVERWRITE="YES" ENCODING="ascii" />