Files

Files

The <files> XML element is used to pass one or more files (encoded in base64) to or from API endpoints. Files may include design files, TrueView™ images, or other related assets in requests and responses.


XML structure

<files>                                           <!-- Root element: container for all file entries -->
  <file 
    filename="design1.emb"         <!-- Name of the file (with extension); used as a unique identifier -->
    filecontents="..."                       <!-- Base64-encoded file contents -->
  />
  <file 
    filename="design2.emb"       <!-- Another file entry -->
    filecontents="..." 
  />
  <file 
    filename="trueview.png"      <!-- Typically an image preview or render -->
    filecontents="..." 
  />
</files>

Usage

The <files> XML element is used in the following API calls:

As input:

  1. api/designInfo

    As input & output:

    1. api/designTrueview
    2. api/newDesignTrueview
    3. api/newDesign
    4. api/newLetteringPreview


    Elements

    ✅ <files>

    Root element containing one or more <file> elements. It defines the complete set of files used or produced by the API request.

    ✅ <file>

    Represents a single file in the list...
    Attribute
    Description
    filename
    The name of the file, including its extension – e.g. EMB for embroidery designs, PNG for images. This name serves as the unique identifier for referencing the file elsewhere in the request or response.
    filecontents
    Contains the file data encoded as a Base64 string. This allows binary file content to be safely transferred in XML format.


    Encoding notes

    When constructing XML, remember certain characters must be escaped to remain valid in XML attribute values:
    Character
    Escaped as
    <
    &lt;
    &
    &amp;
    "
    &quot; (if using double quotes as delimiters)
    '
    &apos; (if using single quotes as delimiters)


    Remarks

    1. Use multiple <file> elements if you're sending or receiving more than one file. Each <file> can represent an input — such as an uploaded design — or an output — such as a generated TrueView image.
    2. Each filecontents value should be a base64 string — typically generated by reading the file as binary and encoding it.
    3. Ensure that special XML characters in filename are properly escaped — e.g. &&amp;.
    4. Filenames must be unique within the same request/response to avoid ambiguity.