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:
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 |
< | < |
& | & |
" | " (if using double quotes as delimiters) |
' | ' (if using single quotes as delimiters) |
- 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.
- Each filecontents value should be a base64 string — typically generated by reading the file as binary and encoding it.
- Ensure that special XML characters in filename are properly escaped — e.g. & → &.
- Filenames must be unique within
the same request/response to avoid ambiguity.