Upload attachment
upload_attachmentAttach a local file to an OpenProject element (work package, wiki, meeting, document, budget, or comment) with local size validation before transfer.
Instructions
Attach a local file to a work package, wiki page, meeting, document, budget or comment.
Use it when a file that already exists on the server's machine should be added to an existing container. The file's existence and its size against this instance's maximumAttachmentFileSize are checked locally first, so an oversized file fails instantly instead of after the transfer.
Returns the created attachment row (id, file_name, size_bytes, content_type, description, author, created_at, status) — the id feeds download_attachment.
Pitfalls: uploading to a container needs edit permission on that container, so to give a brand-new work package its files use create_work_package(attachment_paths=[...]) instead, which uploads the files unattached and claims them on create. Instances may restrict extensions; a rejected type comes back as validation_failed with the allowlist hint and nothing is stored. The stored name comes from file_name (or the path's basename), never from the multipart part.
Related: list_attachments shows what a container already holds; download_attachment is the reverse direction.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_name | No | Name to store the file under, with extension. This is the only thing that decides the stored name: OpenProject ignores the multipart filename and re-detects the content type from the bytes. Defaults to the basename of file_path. | |
| file_path | Yes | Absolute path of the file to upload, on the machine running this server. Existence and size are checked locally before anything is transferred. | |
| description | No | Optional caption shown next to the file in OpenProject. | |
| container_id | Yes | Numeric id of the container: work package id, wiki page id, meeting id, document id, budget id, or activity id for 'comment'. | |
| container_type | Yes | Kind of object to attach the file to. Use 'comment' to attach to a work-package comment and pass its activity id as container_id. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Attachment id; pass it to download_attachment. | |
| author | No | User who uploaded the file. | |
| status | No | Virus-scan state: 'uploaded'/'scanned' are downloadable, 'quarantined' is not, anything else is still being scanned. | |
| file_name | No | Stored file name including extension. | |
| created_at | No | ISO 8601 UTC upload timestamp. | |
| size_bytes | No | File size in bytes. | |
| description | No | Caption stored with the file. | |
| content_type | No | MIME type detected by OpenProject from the bytes. |