Troubleshooting
Problem
We have a provider RAD for a file upload by a multipart/form-data POST.
The Open API3 specification is as follows :
(...) paths: '/docs': post: tags: - test summary: test upload multipart description: test upload multipart operationId: postTestMtp requestBody: description: fichier content: multipart/form-data: schema: $ref: '#/components/schemas/document' required: true responses: '201': description: Created '400': $ref: '#/components/responses/400' '401': $ref: '#/components/responses/401' '403': $ref: '#/components/responses/403' '500': $ref: '#/components/responses/500' components: schemas: document: title: document type: object properties: file: type: string format: binary (...)
The generated service has the following input (see attached image input.png) :
- requestBody (document)
- _untitled_1 (document)
- $part_1 (document)
- contentType (string)
- file (byte[])
- $part_1 (document)
- _untitled_1 (document)
The received content-type is OK, the contents of the file is OK too, the problem is that the filename sent by the client is lost, it is nowhere in the input pipeline.
The filename is sent by the client in a standard way :
------WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="testmultipart.txt" Content-Type: text/plain (data) ------WebKitFormBoundary7MA4YWxkTrZu0gW--
How can we access the filename property of the “file” part ?
Document Location
Worldwide
[{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSVYEV","label":"IBM webMethods Integration"},"ARM Category":[{"code":"a8mKe00000000AQIAY","label":"webMethods Integration Server (PIE)"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"10.15"},{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSFIWYE","label":"IBM webMethods B2B"},"ARM Category":[{"code":"a8mKe00000000AQIAY","label":"webMethods Integration Server (PIE)"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"10.15"},{"Line of Business":{"code":"LOB77","label":"Automation Platform"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSQG2X","label":"IBM webMethods Managed File Transfer"},"ARM Category":[{"code":"a8mKe00000000AQIAY","label":"webMethods Integration Server (PIE)"}],"ARM Case Number":"","Platform":[{"code":"PF033","label":"Windows"}],"Version":"10.15"}]
Log InLog in to view more of this document
This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.
Was this topic helpful?
Document Information
Modified date:
20 March 2025
UID
ibm17217733