ReportAttachmentCollection.upload¶
Upload an attachment (multipart/form-data).
JSON-only use_sdk dispatch cannot execute this method — the same
limitation as cloudsprite.resources.cloudscripts.CloudScript.upload_version.
Server: POST /api/reports/{id}/attachments/.
Signature¶
upload(file_path: str) -> ReportAttachment
Parameters¶
| Name | Type | Required | Default |
|---|---|---|---|
file_path |
str |
yes | - |
HTTP parameters¶
| Name | In | Type | Required | Default |
|---|---|---|---|---|
report_id |
path |
string |
yes | - |
Fields¶
| Field | Type | Required |
|---|---|---|
file |
string |
yes |
Return shape¶
HTTP 201 — Created
Schema: ReportAttachmentOut
| Field | Type | Required |
|---|---|---|
content_type |
string |
yes |
created_at |
string |
no |
file_url |
string |
no |
id |
string |
yes |
name |
string |
yes |
report_id |
string |
yes |
size |
integer |
yes |
uploaded_by_id |
string |
no |
uploaded_by_name |
string |
no |
Permission¶
Required permission: report:update
HTTP¶
POST /api/reports/{report_id}/attachments/ (uploadReportAttachment)
Usage¶
report_attachment_collection.upload(file_path)