Skip to main content

File Upload with Tags

  • optional

A Template Package can include both files and their associated tags, which are intended to be created within the File Service of the selected project during deployment. Tags are defined in the manifest.files array by specifying each file’s name and path. The actual files to be created must be placed inside the fileUploads folder within the ZIP archive.

The structure of the fileUploads folder is critical, as it determines how files and folders are created, preserving parent-child relationships based on the folder hierarchy.

To associate tags with files during deployment, the system uses the _name and _path properties to match each file to its corresponding tag. If no match is found, the file is created without any tags.

It is important to note that files can still be created without tags simply by placing them in the fileUploads folder, even if they are not listed in the manifest.files array.

During deployment:

  • If a folder already exists, its creation is skipped.
  • If a file already exists, a new version is created.
  • If neither exists, both the folder and file are created from scratch.

Complete Example:#

// manifest.json{   "Template Name": "Water Treatment Operations Digital Twin",   "Template Version": "1.0.5",   "files": [      {         "_name": "testone.txt",         "_path": "", // Root         "_tags": ["testPathOne", "testPathTwo"]      },       {         "_name": "hello.txt",         "_path": "testFolderOne/hello",         "_tags": ["testPathOne", "testPathTwo"]      }   ]}
// Package Zip FileWater Treatment Template.zip /|-- filesUpload /||   |-- testone.txt||   |-- waterTreatmentTemplate.bimpk||   |-- testFolderOne /||       |-- a.txt||       |-- hello /||           |-- hello.txt||-- manifest.json