Administrators can add an attachment by uploading a control file synchronously or asynchronously.
The following shows a control file that synchronously attaches a resource to a document:
attachments sheet
| document (filePath) | filePath | originId | displayName | filename |
|---|---|---|---|---|
| path_to_the_document_to_be_updated | path_to_the_file_to_attach | desired_origin_id | title to display | filename to display |
<?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 only possible to define the
insertAtvalue of an attachment when uploading a control file synchronously. - It is not possible to define the
insertAtvalue with a spreadsheet control file.
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>
</attachment>
</attachments>
</resource>
</resources>
</controlFile>
It is not possible to asynchronously add an attachment already uploaded to a Fluid Topics portal using a spreadsheet control file.
- When uploading a control file asynchronously, use the same source as the content it is targeting.
- See XML template for more information about the XML elements.