From 3af6f14bb7f9aee1a724a8e4f9ee5778f6b98df8 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Mon, 14 Sep 2026 12:31:43 +0200 Subject: [PATCH] Send a global file input to the endpoint that accepts files The upload went to /globals/{key}, which takes JSON, and came back as an unsupported content type; the array variant additionally named its parts after the input, which nothing binds on. Both now use the multipart routes that exist for this, with the part names those routes read. Co-Authored-By: Claude Opus 5 (1M context) --- .../services/task-executions/task-executions-call.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/app/services/task-executions/task-executions-call.ts b/src/app/services/task-executions/task-executions-call.ts index 5c1c315..7e258bd 100644 --- a/src/app/services/task-executions/task-executions-call.ts +++ b/src/app/services/task-executions/task-executions-call.ts @@ -284,7 +284,9 @@ export class TaskExecutionsCallService extends TaskExecutionsCallServiceBase { inputName: string, file: File ): Observable { - const url = `${environment.apiUrl}/executions/${encodeURIComponent(executionId)}/globals/${encodeURIComponent(inputName)}`; + // The bare /globals/{key} endpoint takes JSON, so an upload sent there came back as an + // unsupported content type; the upload has its own route, as it does for a node input. + const url = `${environment.apiUrl}/executions/${encodeURIComponent(executionId)}/globals/${encodeURIComponent(inputName)}/file`; const formData = new FormData(); formData.append('file', file); return this.http.put(url, formData).pipe(map((raw) => this.mapExecution(raw))); @@ -295,11 +297,12 @@ export class TaskExecutionsCallService extends TaskExecutionsCallServiceBase { inputName: string, files: File[] ): Observable { - const url = `${environment.apiUrl}/executions/${encodeURIComponent(executionId)}/globals`; + const url = `${environment.apiUrl}/executions/${encodeURIComponent(executionId)}/globals/${encodeURIComponent(inputName)}/files`; const formData = new FormData(); - formData.append('key', inputName); + // Every file goes under "files": the part name is what the endpoint binds on, and naming the + // parts after the input meant nothing bound at all. for (const file of files) { - formData.append(inputName, file); + formData.append('files', file); } return this.http.put(url, formData).pipe(map((raw) => this.mapExecution(raw))); }