
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upload file with API rest (PUT) with talend
I'm using a PUT Method to upload a file in a tool (Anaplan).
I tried with POSTMAN and it works fine (i put the file in the binary of the body and the content-type is "application/octet-stream")
But when i try to do it with talend the result is different either with tRestclient or classic tRest. The headers are same as postman and the body is "-upload-file C:/xxx/ANAPLAN/20240605_165600_DP_Warehouse_Full.csv"
Is there anyway I can upload file as binary in trest component or any other component.
Here is the link to the API documentation : https://help.anaplan.com/load-the-import-file-chunks-011d23cf-4acf-43a8-8b92-3dc5f07d7b6a
Thanks in advance
Accepted Solutions


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Short answer:
No, it is not possible using tREST or tRESTClient.
I had a similar issue with Microsoft Graph file Uploads, and I ended up having to program it in Java as a custom Code Routine in Talend.
If you want to try something lite that for yourself, here is a post from someone who created this using Java:
https://community.anaplan.com/discussion/51791/uploading-file-via-rest-api-and-triggering-imports
As you can see, he turns the file into a ByteArrayInputStream.
So, unfortunately, no easy fix for this.
Expect to do some Java development to pull this off...


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Short answer:
No, it is not possible using tREST or tRESTClient.
I had a similar issue with Microsoft Graph file Uploads, and I ended up having to program it in Java as a custom Code Routine in Talend.
If you want to try something lite that for yourself, here is a post from someone who created this using Java:
https://community.anaplan.com/discussion/51791/uploading-file-via-rest-api-and-triggering-imports
As you can see, he turns the file into a ByteArrayInputStream.
So, unfortunately, no easy fix for this.
Expect to do some Java development to pull this off...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, thanks for your solution. i didn't apply exactly the same code but i use a java routine very similar to this code and it works.
