You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit d2a2cde
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: content/docs/api/plugin-endpoints.mdx
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -154,7 +154,7 @@ other adapter.
154
154
| Method | Endpoint | SDK | Description |
155
155
|:-------|:---------|:----|:------------|
156
156
| POST |`/storage/upload/presigned`|`storage.getPresignedUrl`| Step 1 — mint an upload target for a new `sys_file` row |
157
-
| POST |`/storage/upload/complete`|`storage.upload`| Step 3 — commit the uploaded bytes |
157
+
| POST |`/storage/upload/complete`|`storage.upload`| Step 3 — commit the uploaded bytes; with `attachTo`, also attach the file to a record as the caller|
158
158
| POST |`/storage/upload/chunked`|`storage.initChunkedUpload`| Open a chunked / resumable session |
159
159
| PUT |`/storage/upload/chunked/:uploadId/chunk/:chunkIndex`|`storage.uploadPart`| Send one chunk |
160
160
| POST |`/storage/upload/chunked/:uploadId/complete`|`storage.completeChunkedUpload`| Assemble the parts |
@@ -167,6 +167,13 @@ other adapter.
167
167
so for a file whose type the browser does not know (`file.type === ''`) the
168
168
helper sends `application/octet-stream`; a typed file keeps its own type.
169
169
170
+
To attach the upload to a record's Attachments, send `attachTo: {parentObject,
171
+
parentId}` with step 3 (and start the upload with `scope: 'attachments'`): the
172
+
commit and the `sys_attachment` row are one unit, written as the signed-in
173
+
caller, and the answer carries the `attachmentId`
174
+
([attachment access](/docs/permissions/attachments-access)). A refused attach
175
+
leaves the upload pending.
176
+
170
177
A file field takes the `fileId` only after step 3. A signed-in record write
171
178
that names a file whose upload was never completed is refused with `400
172
179
VALIDATION_FAILED`, one `invalid_value` entry naming the field and the file,
| Attach on upload completion (`attachTo`) | the caller's own pending, unattached `attachments`-scope upload, then every create check |`PERMISSION_DENIED` (403) / `RESOURCE_CONFLICT` (409), then the create codes |
227
261
| Attach (create), re-point | a by-id update of the parent record by the caller would be admitted |`ATTACHMENT_PARENT_ACCESS` (403); `OBJECT_NOT_FOUND` (404) when the parent object is not registered |
| Delete | uploader or parent editor (+ RBAC delete grant) |`ATTACHMENT_DELETE_DENIED` (403); `PERMISSION_DENIED` (403) when the parent is not readable or no delete grant is held |
Copy file name to clipboardExpand all lines: packages/services/service-storage/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ All routes are mounted at `/api/v1/storage` (configurable via `basePath`).
129
129
| Method | Path | Description |
130
130
|--------|------|-------------|
131
131
| POST |`/upload/presigned`| Get presigned upload URL |
132
-
| POST |`/upload/complete`| Mark upload as committed |
132
+
| POST |`/upload/complete`| Mark upload as committed; with `attachTo: { parentObject, parentId }`, attach the caller's own pending upload to that record as the caller, in the same unit|
133
133
| POST |`/upload/chunked`| Initiate chunked upload |
134
134
| PUT |`/upload/chunked/:uploadId/chunk/:chunkIndex`| Upload a chunk |
135
135
| POST |`/upload/chunked/:uploadId/complete`| Complete chunked upload |
0 commit comments