AI agent getting started? Read Agents: start here first.
Attach a file to an object property when the file belongs with that engineering record. You can do this in the object details panel or with the openeng CLI.
Choose where the file belongs
Section titled “Choose where the file belongs”A file is the value of a declared attachment property on an existing object. Use a drawing property on a Part, evidence on a Verification, or a PDF specification on a Requirement. The selected branch determines the version you are reading or replacing.
Attach a file in the workspace
Section titled “Attach a file in the workspace”You need write access, an existing attachment field and a file within the per-file size limit. The organisation’s stored bytes must be below its storage limit when you open the upload. The declaration’s size does not change that storage admission answer within the per-file limit. A PDF drawing, for example, needs a field that accepts PDFs. If there is no suitable field, add one to the type first.
- Open the object details panel and find its attachment property.
- Choose Attach file.
- Choose a file whose type is accepted by the property.
- In the Reason for this change field, write the reason like a commit message (see Propose, compare and merge), then choose Attach.
- Watch the committed bytes and total while the file uploads. You can choose Cancel; the drawer then shows Cancelled. A dropped connection resumes within the same upload.
- Wait through Saving… for Saved before leaving the object.
The drawer shows No file when the property is empty. After an upload, it shows the file name and size. Choose Download to save a copy.
With read-only access, you can see the file name and size and download it; attach, replace and clear controls are hidden.
- For
too-large, choose a file within the per-file limit (1 GiB in production). Forstorage-limit-reached, ask an operator to review the organisation’s available storage. - If its content or extension is unsupported, choose a supported file and check that its name matches its type.
- For
upload-not-found, start the upload again. If your sign-in session ended, sign in again.
The platform calls unsupported extensions or content unsupported-content. A file on object creation
is refused with attachment-requires-object; create the object first, then attach the file.
See Refusals for other platform rejection reasons.
Use the CLI
Section titled “Use the CLI”Use the project ID and the branch containing the object; the --ref flag takes the branch name. Get the object ID from a graph query; see Query across relationships. The property key identifies where the file will be saved.
openeng attachment add <object-id> drawing ./drawing.pdf --project <project-id> --ref <branch> --reason "Attach the released drawing"The --reason flag is required. Write it like a commit message, as Propose, compare and merge teaches; the platform writes it first in the commit message, and the command refuses an empty reason before it sends anything.
The CLI uploads directly to the file store using lazy file reads and prints upload and download
progress to standard error. A dropped connection resumes from the store’s committed offset within
the same call, with up to three resumes per piece. The SDK uses the same direct upload and accepts
{ onProgress: (committed, total) => void } as the third argument to
uploadAttachment(selector, source, options). An open refused as storage-limit-reached sends no file bytes.
Start with a small PDF and an existing object whose published type declares drawing as a PDF attachment. Replace each placeholder with the returned ID or branch name. The command prints the attachment descriptor as JSON when it succeeds. List the object’s attached files with:
openeng attachment list <object-id> --project <project-id> --ref <branch>Download a file to its saved name, or choose a path with --out. The command writes the file as it arrives, checks it against the stored checksum, and keeps no partial file if the check fails. A large file is read from the platform’s file store, not through the platform host:
openeng attachment get <object-id> drawing --out ./downloaded-drawing.pdf --project <project-id> --ref <branch>Open the downloaded PDF and confirm it is the file you attached. See CLI reference for command syntax and options.
Replace or clear a file
Section titled “Replace or clear a file”- To replace a file, choose Replace file in the drawer and select the replacement. In the Reason for this change field, write a commit-message reason (see Propose, compare and merge), then choose Replace.
- To remove the file from the property, choose Clear. In the Reason for this change field, write a commit-message reason (see Propose, compare and merge), then choose Clear.
- Wait for Saved, which confirms either change succeeded.
The CLI supports adding, listing and downloading attachments. It has no command to clear an attachment; use Clear in the workspace.
View files
Section titled “View files”Object type views can show an STL mesh, an image or a PDF when configured for a matching attachment property. An image view needs alternative text. A STEP file can be downloaded, but the drawer does not preview it. A file larger than the viewer shows (images 50 MiB, PDFs 100 MiB, meshes 64 MiB) is not previewed: the panel shows the file name, its size and Download, and the file is not read until you choose Download. Large downloads are read directly from the file store.
Add an attachment field to a type
Section titled “Add an attachment field to a type”- Open a type change set to edit the object type.
- Add a top-level property with kind
attachmentand anacceptlist of file classes. For example,drawing: { kind: "attachment", accept: ["pdf"] }accepts PDF files. - Publish the type change before attaching files to objects of that type.
Available classes are image, pdf, step, mesh and text. The accepted class also restricts the file’s
extension and content. Images may be PNG, JPEG, WebP or GIF. Mesh files use STL; STEP files use .step or
.stp. Text includes formats such as TXT, Markdown, CSV, JSON and YAML. The host sets the per-file limit (1 GiB
in production); the organisation must also have storage available.
When the file is ready, review the change on its branch with the engineering record it supports.