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
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....
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.