tfileinputraw then tRest : in order to attach a pdf file in a couchdb

Five Stars

tfileinputraw then tRest : in order to attach a pdf file in a couchdb

Hello ,
I try to attach a pdf file into a couchdb base.
First I use the tfileinputraw component with "Read the file as a bytes array"
After I want to use a tRest component.
Could you tell me what is the name of the variable which gives the content of the pdf file.
Thanks in advance
tFileInputRAw --> tRest
Five Stars

Re: tfileinputraw then tRest : in order to attach a pdf file in a couchdb

What do I put in "Corps HTTP" to load the pdf file ?
Community Manager

Re: tfileinputraw then tRest : in order to attach a pdf file in a couchdb

Use a tFlowToIterate after the tFileInputRaw. This will store the byte array in the globalMap HashMap with the key "row.column" (replace row for the row name and column for the column name leaving the tFlowToIterate). Then connect from the tFlowToIterate to the tRest using the Iterate connector. Once this is connected, set the Http Body field to the value held by the globalMap. It will look something like below....
((byte[])globalMap.get("row.body"))

You will also need to set a header in the HTTP Headers section. The header name is "Content-Type" and the value will likely be "application/octet-stream".
This should work, but there is always a bit of jiggery pokery required when sending files via web service. 
Oh, the HTTP Method will likely be POST.
Five Stars

Re: tfileinputraw then tRest : in order to attach a pdf file in a couchdb

Just excuse me , i have already done this :
https://www.talendforge.org/forum/viewtopic.php?id=47378
Community Manager

Re: tfileinputraw then tRest : in order to attach a pdf file in a couchdb

Did that not work? I am confused.
Five Stars

Re: tfileinputraw then tRest : in order to attach a pdf file in a couchdb

No no , it's works . Thanks

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now