<?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: tRestClient MIME Multipart Form Data POST to post zip file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199112#M2167</link>
    <description>I have the same problem with a image file</description>
    <pubDate>Thu, 30 Apr 2015 17:06:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-04-30T17:06:28Z</dc:date>
    <item>
      <title>tRestClient MIME Multipart Form Data POST to post zip file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199110#M2165</link>
      <description>Hi&lt;BR /&gt;How can I use tRestClient to post a zip file to a webservice?&lt;BR /&gt;This should be doen as&amp;nbsp; MIME Multipart Form Data POST request.&lt;BR /&gt;Any help is appreciated.&lt;BR /&gt;tx&lt;BR /&gt;Luc</description>
      <pubDate>Mon, 15 Dec 2014 22:10:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199110#M2165</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-15T22:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient MIME Multipart Form Data POST to post zip file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199111#M2166</link>
      <description>Hi&lt;BR /&gt;I noticed that effort is been put in place to extend the tRest(serverside)components to support MIME Multipart Form.&lt;BR /&gt;How could we have the same on the consumer side for tRestClient?&lt;BR /&gt;We are using tRestClient to consume succefully a Rest webservice (including oAuth) via Get and Post calls with XML Content type.&lt;BR /&gt;Now we need to be able to post a zip file.&lt;BR /&gt;tx&lt;BR /&gt;Luc</description>
      <pubDate>Tue, 16 Dec 2014 10:20:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199111#M2166</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-12-16T10:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient MIME Multipart Form Data POST to post zip file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199112#M2167</link>
      <description>I have the same problem with a image file</description>
      <pubDate>Thu, 30 Apr 2015 17:06:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199112#M2167</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-30T17:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient MIME Multipart Form Data POST to post zip file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199113#M2168</link>
      <description>Hi 
&lt;BR /&gt;This is how we solved it in a quick and dirty hacky way, but it works. 
&lt;BR /&gt; 
&lt;BR /&gt;Under TOS_ESB-r117442-V5.4.2\Studio\plugins\org.talend.designer.esb.components.rs.consumer_5.4.2.r117442\components\tRESTClient 
&lt;BR /&gt; 
&lt;BR /&gt;(make a copy of the directory in case it does not work) 
&lt;BR /&gt;------------------------------------------------------------- 
&lt;BR /&gt; 
&lt;BR /&gt;in tRESTClient_main.javajet after line 315&amp;nbsp; 
&lt;BR /&gt; 
&lt;BR /&gt;I added this: 
&lt;BR /&gt;&amp;lt;% } else if ("multipart/form-data".equals(contentType) &amp;amp;&amp;amp; !"GET".equals(method) &amp;amp;&amp;amp; !"DELETE".equals(method)) { %&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% for (Map&amp;lt;String, String&amp;gt; query : queries) { %&amp;gt; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println("file=" + &amp;lt;%=query.get("VALUE")%&amp;gt;); 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; String zipfilename = &amp;lt;%=query.get("VALUE")%&amp;gt;.contains("/")?&amp;lt;%=query.get("VALUE")%&amp;gt;.substring(&amp;lt;%=query.get("VALUE")%&amp;gt;.lastIndexOf("/")+1):&amp;lt;%=query.get("VALUE")%&amp;gt;; 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; org.apache.cxf.jaxrs.ext.multipart.ContentDisposition cd_&amp;lt;%=cid%&amp;gt; = new org.apache.cxf.jaxrs.ext.multipart.ContentDisposition("attachment;filename=" + zipfilename); 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; java.io.InputStream is_&amp;lt;%=cid%&amp;gt; = new java.io.FileInputStream(&amp;lt;%=query.get("VALUE")%&amp;gt;); 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; org.apache.cxf.jaxrs.ext.multipart.Attachment att_&amp;lt;%=cid%&amp;gt; = new org.apache.cxf.jaxrs.ext.multipart.Attachment("root", is_&amp;lt;%=cid%&amp;gt; , cd_&amp;lt;%=cid%&amp;gt;); 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; requestBody_&amp;lt;%=cid%&amp;gt; = new org.apache.cxf.jaxrs.ext.multipart.MultipartBody(att_&amp;lt;%=cid%&amp;gt;); 
&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;% } %&amp;gt; 
&lt;BR /&gt; 
&lt;BR /&gt;NOTE: you can see (in the new version at line 320 at the end)&amp;nbsp; this is a bit hardcoded here in the sense that the queryparameter is hardcoded and named "zipfile". 
&lt;BR /&gt;------------------------------------------------------------- 
&lt;BR /&gt;in&amp;nbsp; tRESTClient_java.xml after line 80 
&lt;BR /&gt;I added this: 
&lt;BR /&gt;&amp;lt;ITEM NAME="MULTIPARTFORM" VALUE="multipart/form-data" /&amp;gt; 
&lt;BR /&gt;------------------------------------------------------------- 
&lt;BR /&gt;forgot to mention: 
&lt;BR /&gt;in file tRESTClient_messages.properties 
&lt;BR /&gt;After line 35: 
&lt;BR /&gt;added: 
&lt;BR /&gt;CONTENT_TYPE.ITEM.MULTIPARTFORM=MULTIPARTFORM 
&lt;BR /&gt; 
&lt;BR /&gt; 
&lt;BR /&gt;------------------------------------------------------------ 
&lt;BR /&gt;restart Talend and drag the component on the canvas. 
&lt;BR /&gt;------------------------------------------------------------ 
&lt;BR /&gt;In the user infterface (component) 
&lt;BR /&gt; 
&lt;BR /&gt;With the Content-type dropdwon now contains "MULTIPARTFORM" (select this) 
&lt;BR /&gt;In the query parameters section add a parameter (clicking the + button) and name the parameter "zipfile", (see the note higher up on the hardcoding) 
&lt;BR /&gt;while the value for this query parameter named "zipfile"&amp;nbsp; can be set like any other values in Talend. The value should point to a location to get the zipfile (or in your case the imagefile). 
&lt;BR /&gt;Hoping this will help. I cannot take any responsibility in this. 
&lt;BR /&gt;I hope it might be picked up by propper Talend developers &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;</description>
      <pubDate>Thu, 30 Apr 2015 17:44:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199113#M2168</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-04-30T17:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: tRestClient MIME Multipart Form Data POST to post zip file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199114#M2169</link>
      <description>Hi Luc, 
&lt;BR /&gt;The line numbers are not matching the current Talend version anymore. I had the same problem but a slightly different solution which I documented 
&lt;A href="http://talend.nl/talend-tech-tip-calling-a-rest-service-for-file-upload/" target="_blank" rel="nofollow noopener noreferrer"&gt;overhere&lt;/A&gt;.&amp;nbsp; 
&lt;BR /&gt;It would be better if Talend includes this functionality in the component in a future release, but for now this works for me.</description>
      <pubDate>Wed, 31 Aug 2016 13:03:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tRestClient-MIME-Multipart-Form-Data-POST-to-post-zip-file/m-p/2199114#M2169</guid>
      <dc:creator>Aukema</dc:creator>
      <dc:date>2016-08-31T13:03:34Z</dc:date>
    </item>
  </channel>
</rss>

