eluanb commented on PR #6491:
URL: https://github.com/apache/hop/pull/6491#issuecomment-3911910262
Sorry for the delay in getting back to this — I had some personal issues
over the last few weeks.
This patch improves the **HTTP Post** transform when sending a **file via
multipart**. Today the multipart **file part name** is hardcoded as `"file"`,
which breaks integrations with APIs that require a specific field name (e.g.,
`report`, `upload`, `document`, etc.).
With this change, the transform uses the value configured in the step’s
**Request entity field** as the multipart part name, with a fallback to
`"file"` when the field is empty, preserving the current default behavior.
**Code changes (HttpPost.java):**
* Add:
* `final String partName =
StringUtils.isBlank(resolve(meta.getRequestEntity())) ? "file" :
resolve(meta.getRequestEntity());`
* Replace the hardcoded `"file"` in
`MultipartEntityBuilder.addBinaryBody(...)` with `partName` in the **Post a
file** and **Multipart upload** branches (around lines ~625 and ~637).
The patch file is attached.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]