encEncode

Version 24.2.9039


encEncode


Encodes a file or string of data in a specified encoding format.

Required Parameters

You must provide a value for one of the following fields, but not both:

  • data: The data to encode.
  • file: The file to encode.

Optional Parameters

  • format: The format to use for encoding. Available values are BASE64, HEX, HMAC, HTML, JIS, MD5, QP, SHA1, URL, UU, and YENC. The default is BASE64.
  • outfile: The file in which to store the encoded data.
  • outformat: The format to use for encoded data. Available values are RAW, BASE64, and HEX. The default is RAW.

Output Attributes

  • encodeddata: The encoded data.
  • format: The format used for encoding.
  • outfile: If you specified an input value for outfile, this is the file that contains the encoded data.

Example

The following ArcScript code, when placed in a Script connector, reads data from an input file at [FilePath], encodes it in the default BASE64 format, then pushes the file out:

<!-- setting the file and format for the input item -->
<arc:set attr="enc.file" value="[FilePath]" />
<arc:set attr="enc.format" value="BASE64" />

<arc:call op="encEncode" in="enc" out="result">
  <!-- setting the output file data to be the encoded data returned from the operation -->
  <arc:set attr="output.data">[result.encodeddata]</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 articles are real-world use cases that use the encEncode operation: