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))); }