Administrators can add an attachment by uploading a control file synchronously or asynchronously.
The following lines show a control file that attaches a resource to a document:
<?xml version="1.0" ?>
<controlFile>
<resources>
<resource>
<filePath>path_to_the_document_to_be_updated</filePath>
<attachments>
<attachment>
<filePath>path_to_the_file_to_attach</filePath>
<originId>desired_origin_id</originId>
<displayName>title to display</displayName>
<filename>filename to display</filename>
<insertAt>3</insertAt>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>
It is also possible to asynchronously add an attachment already uploaded to a Fluid Topics portal by targeting it by its khubId
as follows:
<?xml version="1.0" ?>
<controlFile>
<resources>
<resource>
<filePath>path_to_the_document_to_be_updated</filePath>
<attachments>
<attachment>
<khubId>khub_id_of_attachment_to_add</khubId>
<originId>desired_origin_id</originId>
<displayName>title_to_display</displayName>
<filename>filename_to_display</filename>
<insertAt>3</insertAt>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>
- When uploading a control file asynchronously, use the same source as the content it is targeting.
- See Fluid Topics control file template for more information about the XML elements.