<?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 Using TREST how to upload local csv file to azure blob. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335675#M104213</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please suggest how to upload local file saved in a network drive to Azure blob?&amp;nbsp; I cannot use tfilefetch because of file is saved in the local drive and upload to Azure blob.&amp;nbsp; It works in reverse.&amp;nbsp; Fetching file from blob and dropping it to local drive.&amp;nbsp; Tried TREST component and it only saves the header and not the file content.&amp;nbsp; I am not able to make below code work that provided as a solution for TREST.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OkHttpClient client = new OkHttpClient();&lt;BR /&gt;File sourceFile = new File("C:drive/text.csv");&lt;BR /&gt;MediaType mediaType = MediaType.parse("multipart/form-data");&lt;BR /&gt;RequestBody body = new MultipartBody.Builder()&lt;BR /&gt;.setType(MultipartBody.FORM)&lt;BR /&gt;.addFormDataPart("file", "&lt;SPAN&gt;C:drive/text&lt;/SPAN&gt;&lt;SPAN&gt;.csv&lt;/SPAN&gt;",RequestBody.create(MediaType.parse("/csv"), sourceFile) )&lt;BR /&gt;.addFormDataPart("objectName", "project")&lt;BR /&gt;.addFormDataPart("objectProperty", "documents")&lt;BR /&gt;.addFormDataPart("objectId", context.newProjectId)&lt;BR /&gt;.build();&lt;BR /&gt;Request request = new Request.Builder()&lt;BR /&gt;.url("&lt;A href="https://azur" target="_blank"&gt;https://azur&lt;/A&gt;")&lt;BR /&gt;.post(body)&lt;BR /&gt;.addHeader("content-type", "application/csv")&lt;BR /&gt;.addHeader("cache-control", "no-cache")&lt;BR /&gt;.build();&lt;BR /&gt;Response response = client.newCall(request).execute();&lt;BR /&gt;String json = response.body().string();&lt;BR /&gt;System.out.println(json.toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 07:47:48 GMT</pubDate>
    <dc:creator>Attunity_user</dc:creator>
    <dc:date>2024-11-16T07:47:48Z</dc:date>
    <item>
      <title>Using TREST how to upload local csv file to azure blob.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335675#M104213</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could someone please suggest how to upload local file saved in a network drive to Azure blob?&amp;nbsp; I cannot use tfilefetch because of file is saved in the local drive and upload to Azure blob.&amp;nbsp; It works in reverse.&amp;nbsp; Fetching file from blob and dropping it to local drive.&amp;nbsp; Tried TREST component and it only saves the header and not the file content.&amp;nbsp; I am not able to make below code work that provided as a solution for TREST.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OkHttpClient client = new OkHttpClient();&lt;BR /&gt;File sourceFile = new File("C:drive/text.csv");&lt;BR /&gt;MediaType mediaType = MediaType.parse("multipart/form-data");&lt;BR /&gt;RequestBody body = new MultipartBody.Builder()&lt;BR /&gt;.setType(MultipartBody.FORM)&lt;BR /&gt;.addFormDataPart("file", "&lt;SPAN&gt;C:drive/text&lt;/SPAN&gt;&lt;SPAN&gt;.csv&lt;/SPAN&gt;",RequestBody.create(MediaType.parse("/csv"), sourceFile) )&lt;BR /&gt;.addFormDataPart("objectName", "project")&lt;BR /&gt;.addFormDataPart("objectProperty", "documents")&lt;BR /&gt;.addFormDataPart("objectId", context.newProjectId)&lt;BR /&gt;.build();&lt;BR /&gt;Request request = new Request.Builder()&lt;BR /&gt;.url("&lt;A href="https://azur" target="_blank"&gt;https://azur&lt;/A&gt;")&lt;BR /&gt;.post(body)&lt;BR /&gt;.addHeader("content-type", "application/csv")&lt;BR /&gt;.addHeader("cache-control", "no-cache")&lt;BR /&gt;.build();&lt;BR /&gt;Response response = client.newCall(request).execute();&lt;BR /&gt;String json = response.body().string();&lt;BR /&gt;System.out.println(json.toString());&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;pk&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 07:47:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335675#M104213</guid>
      <dc:creator>Attunity_user</dc:creator>
      <dc:date>2024-11-16T07:47:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using TREST how to upload local csv file to azure blob.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335676#M104214</link>
      <description>&lt;P&gt;Anybody??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there an http web service put component that can be used to load csv file to an external location?&amp;nbsp; We cannot use storageblob component for this solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Quest&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 22:09:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335676#M104214</guid>
      <dc:creator>Attunity_user</dc:creator>
      <dc:date>2018-08-21T22:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using TREST how to upload local csv file to azure blob.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335677#M104215</link>
      <description>How about tAzureStoragePut? This component does put files from Local Folder to Azure Storage (container/blobs).</description>
      <pubDate>Wed, 22 Aug 2018 08:30:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335677#M104215</guid>
      <dc:creator>iamabhishek</dc:creator>
      <dc:date>2018-08-22T08:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using TREST how to upload local csv file to azure blob.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335678#M104216</link>
      <description>&lt;P&gt;Hi Abhishek,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the late response. No, I cannot use&amp;nbsp;&lt;SPAN&gt;tAzureStoragePut.&amp;nbsp; I have to either use trestclient or trest.&amp;nbsp; I tried trest and it only saves header.&amp;nbsp; thttprequest works but now thrown error of 413 error code.&amp;nbsp; It worked sometimes when files are smaller. I cannot use tfilefetch, it only works in reverse.&amp;nbsp; I need to fetch a file from local drive and drop to Azure. Any suggestions?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 20:20:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Using-TREST-how-to-upload-local-csv-file-to-azure-blob/m-p/2335678#M104216</guid>
      <dc:creator>Attunity_user</dc:creator>
      <dc:date>2019-01-02T20:20:42Z</dc:date>
    </item>
  </channel>
</rss>

