<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use tHTTPClient &amp;quot;download attachment&amp;quot; with  &amp;quot;use cashe to save file&amp;quot; in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537021#M148192</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/254248"&gt;@Gjeremy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the&amp;nbsp;_INPUT_STREAM hint.&lt;BR /&gt;&lt;BR /&gt;tHTTPClient_1_HTTP_INPUT_STREAM was the missing piece in the puzzle for me.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://help.qlik.com/talend/en-US/components/8.0/http/thttpclient" target="_blank"&gt;( https://help.qlik.com/talend/en-US/components/8.0/http/thttpclient&lt;/A&gt;&amp;nbsp;page needs update in&amp;nbsp; Global Variables section in regards of this )&lt;BR /&gt;&lt;BR /&gt;While we are at cHTTPClient.&lt;BR /&gt;Any hint how to map binary from tHTTPClient_1_HTTP_INPUT_STREAM to tHTTPClient_2 PUT request body?&lt;BR /&gt;&lt;BR /&gt;By default when request body type =&amp;nbsp; binary, the option is enabled to read from file. No clear understanding how to map binary from global variable instead.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rait&lt;/P&gt;</description>
    <pubDate>Mon, 24 Nov 2025 09:05:22 GMT</pubDate>
    <dc:creator>Rait</dc:creator>
    <dc:date>2025-11-24T09:05:22Z</dc:date>
    <item>
      <title>How to use tHTTPClient "download attachment" with  "use cashe to save file"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2535575#M148170</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Simple proxy solution:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Get file (binary) from WebSerice1.&lt;/LI&gt;
&lt;LI&gt;Send file to WebService2 .&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Problem. It seems to me that tHTTPClient by default casts the body response part into String and corrupts file binrary by doing it.&lt;/P&gt;
&lt;P&gt;When I fetch the document using tHTTPClient_1, there are options&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Download attachment&lt;/LI&gt;
&lt;LI&gt;Use cache to save file&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;How can I map the "cached" file into tHTTPClient_2 request body?.&lt;BR /&gt;&lt;BR /&gt;Have not found any good reference where "use cache to save file" stores the content internally in Talend and how to refer to it later on.&lt;BR /&gt;&lt;BR /&gt;NB!&amp;nbsp; I'm not interested to use the option to store the file into local disk folder in the middle of the flow. &lt;BR /&gt;I would prefer that file binary to be carried over by Flow from tHTTPClient_1.response&amp;nbsp; -&amp;gt; tHTTPClient_2.request.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Rait&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2025 07:58:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2535575#M148170</guid>
      <dc:creator>Rait</dc:creator>
      <dc:date>2025-11-07T07:58:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tHTTPClient "download attachment" with  "use cashe to save file"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2536859#M148190</link>
      <description>&lt;P&gt;Hello Rait.&lt;/P&gt;
&lt;P&gt;Use cache to save file will store the file into a Stream that can be accessed with global variable.&lt;BR /&gt;For example if your tHTTPClient is named tHTTPClient_1 :&lt;/P&gt;
&lt;P&gt;You will have a global variable named&amp;nbsp;&lt;SPAN&gt;tHTTPClient_1_HTTP_INPUT_STREAM&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;From the Input Stream you can do what you want.&lt;/P&gt;
&lt;P&gt;Here I wrote a .pdf file in c:/pdf folder from the tHTTPClient response attachment :&amp;nbsp;&lt;/P&gt;
&lt;DIV style="background-color: #ffffff; padding: 0px 0px 0px 2px;"&gt;
&lt;DIV style="color: #000000; background-color: #ffffff; font-family: 'courier'; font-size: 10pt; white-space: pre;"&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;java.io.InputStream &lt;/SPAN&gt;&lt;SPAN&gt;inputStream&lt;/SPAN&gt;&lt;SPAN&gt; = ((java.io.InputStream)&lt;/SPAN&gt;&lt;SPAN&gt;globalMap&lt;/SPAN&gt;&lt;SPAN&gt;.get(&lt;/SPAN&gt;&lt;SPAN&gt;"tHTTPClient_1_HTTP_INPUT_STREAM"&lt;/SPAN&gt;&lt;SPAN&gt;));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;java.io.FileOutputStream &lt;/SPAN&gt;&lt;SPAN&gt;outputStream&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; java.io.FileOutputStream(&lt;/SPAN&gt;&lt;SPAN&gt;"C:/pdf/test1.pdf"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;byte&lt;/SPAN&gt;&lt;SPAN&gt;[] &lt;/SPAN&gt;&lt;SPAN&gt;buffer&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;byte&lt;/SPAN&gt;&lt;SPAN&gt;[1024];&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;int&lt;/SPAN&gt; &lt;SPAN&gt;bytesRead&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;while&lt;/SPAN&gt;&lt;SPAN&gt; ((&lt;/SPAN&gt;&lt;SPAN&gt;bytesRead&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;inputStream&lt;/SPAN&gt;&lt;SPAN&gt;.read(&lt;/SPAN&gt;&lt;SPAN&gt;buffer&lt;/SPAN&gt;&lt;SPAN&gt;)) != -1) {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;outputStream&lt;/SPAN&gt;&lt;SPAN&gt;.write(&lt;/SPAN&gt;&lt;SPAN&gt;buffer&lt;/SPAN&gt;&lt;SPAN&gt;, 0, &lt;/SPAN&gt;&lt;SPAN&gt;bytesRead&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;outputStream&lt;/SPAN&gt;&lt;SPAN&gt;.close();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;inputStream&lt;/SPAN&gt;&lt;SPAN&gt;.close();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="margin: 0;"&gt;&lt;SPAN&gt;Jérémy&lt;/SPAN&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Nov 2025 14:13:09 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2536859#M148190</guid>
      <dc:creator>Gjeremy</dc:creator>
      <dc:date>2025-11-21T14:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tHTTPClient "download attachment" with  "use cashe to save file"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537021#M148192</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/254248"&gt;@Gjeremy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you very much for the&amp;nbsp;_INPUT_STREAM hint.&lt;BR /&gt;&lt;BR /&gt;tHTTPClient_1_HTTP_INPUT_STREAM was the missing piece in the puzzle for me.&amp;nbsp;&lt;BR /&gt;&lt;A href="https://help.qlik.com/talend/en-US/components/8.0/http/thttpclient" target="_blank"&gt;( https://help.qlik.com/talend/en-US/components/8.0/http/thttpclient&lt;/A&gt;&amp;nbsp;page needs update in&amp;nbsp; Global Variables section in regards of this )&lt;BR /&gt;&lt;BR /&gt;While we are at cHTTPClient.&lt;BR /&gt;Any hint how to map binary from tHTTPClient_1_HTTP_INPUT_STREAM to tHTTPClient_2 PUT request body?&lt;BR /&gt;&lt;BR /&gt;By default when request body type =&amp;nbsp; binary, the option is enabled to read from file. No clear understanding how to map binary from global variable instead.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rait&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 09:05:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537021#M148192</guid>
      <dc:creator>Rait</dc:creator>
      <dc:date>2025-11-24T09:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tHTTPClient "download attachment" with  "use cashe to save file"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537068#M148193</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/355186"&gt;@Rait&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;On tHTTPClient component when the body type is set to Binary,&lt;/P&gt;
&lt;P&gt;you can only refer to the path of an existing file.&lt;/P&gt;
&lt;P&gt;In the code I can see it will create a FileInputStream based on the file path :&lt;/P&gt;
&lt;P&gt;} else if (bodyType == BodyFormat.BINARY) {&lt;BR /&gt;InputStream fileInputStream = new FileInputStream(this.queryConfiguration.getFilePath());&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have an example of a call for the webservice were you need to send the binary ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards&lt;/P&gt;
&lt;P&gt;Jérémy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 13:17:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537068#M148193</guid>
      <dc:creator>Gjeremy</dc:creator>
      <dc:date>2025-11-24T13:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use tHTTPClient "download attachment" with  "use cashe to save file"</title>
      <link>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537072#M148194</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/254248"&gt;@Gjeremy&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As I mentioned in original post.&amp;nbsp;&lt;BR /&gt;1. Downoload binary from one webservice ( store it in cache: tHTTPClient_1_HTTP_INPUT_STREAM)&lt;BR /&gt;&lt;STRONG&gt;2. Upload binary to other webservice ( binrary from globalVariable/cache)&lt;/STRONG&gt;&lt;BR /&gt;It's common integration pattern.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Or one can have scenario where:&amp;nbsp;&lt;BR /&gt;1. you receive binary as Base64 decoded string. ( Doesn't matter much how you get it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;BR /&gt;2. you decode Binary ( store it into GlobalVariable)&lt;BR /&gt;&lt;STRONG&gt;3. you need to send Binary to Webservice that expects binary to be in request body.&amp;nbsp;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;Staring point in all cases would be, that you have binary in GlobalVariable and not in local harddrive as file.&lt;BR /&gt;&lt;BR /&gt;with old&lt;STRONG&gt; tREST&lt;/STRONG&gt; component it was simple.&amp;nbsp; There is nice-clean-easy option to map into request body from &lt;EM&gt;&lt;STRONG&gt;(byte[])globalMap.get("YourBinaryVariable")&lt;/STRONG&gt;&lt;/EM&gt;. Works like charm.&lt;BR /&gt;But that component is deprecated and I would rather use tHTTPClient or tRESTClient&amp;nbsp; components instead.&lt;BR /&gt;&lt;BR /&gt;I'm not interested to create temporary file on local drive -&amp;nbsp; extremely dumb way to implement such integration.&lt;BR /&gt;If data is already in memory/cache/globalVariable etc.&amp;nbsp; I want to use it directly from there.&lt;BR /&gt;&lt;BR /&gt;I know there is possibility is to write custom Java HTTP client into tJavaRow etc. but that is ugly workaround in my eyes. I would prefer&amp;nbsp; to use out of box components tHTTPClient or tRestClient etc.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rait&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 13:50:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/How-to-use-tHTTPClient-quot-download-attachment-quot-with-quot/m-p/2537072#M148194</guid>
      <dc:creator>Rait</dc:creator>
      <dc:date>2025-11-24T13:50:35Z</dc:date>
    </item>
  </channel>
</rss>

