Developers · Data
Importing Files
Last updated 1 November 2026
Import images and attachments with their records: the CLI uploads local files during a JSON import.
You can import images and attachments together with the records they belong to. The Insites CLI uploads each file from your computer to the instance's storage during the import and links it to the right record.
What you need
- A table with file properties. In the import format,
attachmentsfill attachment properties andimagesfill image properties. - The files on your disk, at paths the JSON file names.
insites-clisigned in to the environment you import into.
app/schema/car.yml
name: car
properties:
- name: color
type: string
- name: car_document
type: file
- name: car_photo
type: photoNote
The schema marks file and photo as deprecated in favor of upload. The import format's attachments and images lists fill these two types.
Write the import file
data.json
{
"models": [
{
"id": "1",
"type_name": "car",
"properties": { "color": "red" },
"attachments": [
{ "name": "car_document", "url": "import_files/offer.pdf" }
],
"images": [
{ "name": "car_photo", "url": "import_files/car.png" }
]
}
]
}| Key | Meaning |
|---|---|
id | The id in your source data. Stored as the external id, and used to link imported records |
type_name | The table the record belongs to |
properties | Values for the other properties. Every key must be a defined property |
name in a file entry | The property the file goes in |
url in a file entry | The path of the file on your disk |
Run the import
insites-cli data import staging --path data.jsonFor each file, the CLI asks the instance for an upload slot and uploads the file. It then puts the stored file's address in place of the local path, and sends the import. If one file cannot be uploaded, the import stops and names that file. This is how insites-cli 6.4.1 behaves (lib/data/uploadFiles.js).
Common mistakes
- Using
--zip. File upload happens only for a JSON import; a zip is sent as it is. - A path that does not exist. The whole import stops with
Could not uploadand the path. - A property in
propertiesthat the table does not define.