encDecode
Version 24.2.9039
Version 24.2.9039
encDecode
Decodes an encoded file or string of data.
Required Parameters
You must provide a value for one of the following fields, but not both:
- data: The data to decode.
- file: The file to decode.
Optional Parameters
- format: The format to use for decoding. Available values are BASE64, HEX, HTML, JIS, QP, URL, UU, and YENC. The default is BASE64.
- outfile: The file in which to store the decoded data. This is not supported for UU decoding, which uses the filename stored in the encoded file.
- outformat: The format to use for decoded data. Available values are RAW, BASE64, and HEX. The default is RAW.
Output Attributes
- decodeddata: The decoded data.
- format: The format used for decoding.
- outfile: If you specified an input value for outfile, this is the file that contains the decoded data.
Example
The following ArcScript code, when placed in a Script connector, reads BASE64-encoded data from an input file at [FilePath], decodes it, then pushes the file out:
<!-- setting the file and encoding format for the input item -->
<arc:set attr="enc.file" value="[FilePath]" />
<arc:set attr="enc.format" value="BASE64" />
<arc:call op="encDecode" in="enc" out="result">
<!-- setting the output file data to be the decoded data returned from the operation -->
<arc:set attr="output.data">[result.decodeddata]</arc:set>
</arc:call>
<!-- setting the filename and pushing the file out -->
<arc:set attr="output.filename" value="[FileName]" />
<arc:push item="output" />
Additional Resources
The following article is a real-world use case that uses the encDecode operation: