<?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: Large data file upload using REST? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126705#M19288</link>
    <description>&lt;P&gt;You beat me to it,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141812"&gt;@jprdonnelly&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/226619"&gt;@yosuke-coupa&lt;/a&gt;&amp;nbsp;I've been meaning to add some examples to that doc. What language are you trying to use?&lt;/P&gt;
&lt;P&gt;In the example Justin posted, I used curl, but I've got some examples with Python which work in a similar way using stream, e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;headers = {'Authorization': auth, 'Content-type': 'application/octet-stream'}
    params = {'filename': 'import'}
    baseUrl = 'https://' + tenantUrl + '/api/v1/temp-contents'

    # Import to temp-contents
    try:
        with open(filePath, 'rb') as f:
            tempFilePath = requests.post(baseUrl, params=params, stream=True, data=f, headers=headers).headers['Location']
            print("Temporary file path is " + tempFilePath)
            importFileId = tempFilePath.rsplit('/', 1)[-1]
    except:
        raise Exception("Failed while attempting to upload file to temp-contents.")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only complex part is grabbing the ID of the uploaded file, since by default we pass a path. Both the action (&lt;A href="https://github.com/qlik-oss/qlikdev-move-apps-third-party/blob/main/.github/workflows/moveApp.yml#L84" target="_self"&gt;see this line&lt;/A&gt;) and this python example separate out the ID, which you then use as input to create data file. So as an example (excuse the escaping, that's from a windows example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl "https://your-tenant.us.qlikcloud.com/api/v1/data-files" \
 -X POST \
 -H "Authorization: Bearer &amp;lt;API-key&amp;gt;" \
 -H "Content-type: multipart/form-data" \
 -F "Json={\"name\":\"MyFile.csv\",\"tempContentFileId\":\"theIdFromTempContsServiceYouGrabbedEarlier\"}"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll take a note to add examples to that page.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2023 15:59:57 GMT</pubDate>
    <dc:creator>Dave_Channon</dc:creator>
    <dc:date>2023-10-09T15:59:57Z</dc:date>
    <item>
      <title>Large data file upload using REST?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126218#M19281</link>
      <description>&lt;P&gt;The qlik.dev documentation provides a few approaches for data file uploads.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://qlik.dev/manage/data-files/create-datafiles" target="_blank"&gt;Create data files in Qlik Cloud | Qlik Developer Portal&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The issue we're having is uploading large data files, specifically QVD files.&amp;nbsp; The documentation does state the following:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;If you are uploading data files larger than 500 MB, you will need to adjust the upload approach. This is because larger files must be uploaded to the&amp;nbsp;&lt;/SPAN&gt;&lt;CODE class="language-text"&gt;temp-contents&lt;/CODE&gt;&lt;SPAN&gt;&amp;nbsp;API, which supports chunked uploads for these larger files. When using qlik-cli, you add an additional flag, but for raw API approaches you will need to amend your code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The documentation only shows how to upload large files via qlik-cli.&amp;nbsp; Is there any information on how to use REST endpoints for large file uploads?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 20:07:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126218#M19281</guid>
      <dc:creator>yosuke-coupa</dc:creator>
      <dc:date>2023-10-06T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Large data file upload using REST?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126692#M19287</link>
      <description>&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/226619"&gt;@yosuke-coupa&lt;/a&gt;&amp;nbsp;- if you look at the &lt;A href="https://qlik.dev/apis/rest/temp-contents" target="_blank" rel="noopener"&gt;temp-contents&lt;/A&gt;&amp;nbsp;doc page on qlik.dev, it has a little drop-down on the right side that lets you choose between qlik-cli, node.js and curl examples:&lt;/P&gt;
&lt;LI-CODE lang="bash"&gt;curl "https://your-tenant.us.qlikcloud.com/api/v1/temp-contents" \
 -X POST \
 -H "Authorization: Bearer &amp;lt;API-key&amp;gt;" \
 -H "Content-type: application/octet-stream" \
 --data-binary "@/path/to/file"&lt;/LI-CODE&gt;
&lt;P&gt;Once you are able to upload to temp-contents, you can import the file into the destination Space. You can see an example of that in &lt;A href="https://raw.githubusercontent.com/qlik-oss/qlikdev-move-apps-third-party/main/.github/workflows/moveApp.yml" target="_blank" rel="noopener"&gt;this qlik-oss GitHub action YAML.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheers!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 15:20:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126692#M19287</guid>
      <dc:creator>jprdonnelly</dc:creator>
      <dc:date>2023-10-09T15:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Large data file upload using REST?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126705#M19288</link>
      <description>&lt;P&gt;You beat me to it,&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141812"&gt;@jprdonnelly&lt;/a&gt;!&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/226619"&gt;@yosuke-coupa&lt;/a&gt;&amp;nbsp;I've been meaning to add some examples to that doc. What language are you trying to use?&lt;/P&gt;
&lt;P&gt;In the example Justin posted, I used curl, but I've got some examples with Python which work in a similar way using stream, e.g.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;headers = {'Authorization': auth, 'Content-type': 'application/octet-stream'}
    params = {'filename': 'import'}
    baseUrl = 'https://' + tenantUrl + '/api/v1/temp-contents'

    # Import to temp-contents
    try:
        with open(filePath, 'rb') as f:
            tempFilePath = requests.post(baseUrl, params=params, stream=True, data=f, headers=headers).headers['Location']
            print("Temporary file path is " + tempFilePath)
            importFileId = tempFilePath.rsplit('/', 1)[-1]
    except:
        raise Exception("Failed while attempting to upload file to temp-contents.")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only complex part is grabbing the ID of the uploaded file, since by default we pass a path. Both the action (&lt;A href="https://github.com/qlik-oss/qlikdev-move-apps-third-party/blob/main/.github/workflows/moveApp.yml#L84" target="_self"&gt;see this line&lt;/A&gt;) and this python example separate out the ID, which you then use as input to create data file. So as an example (excuse the escaping, that's from a windows example):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl "https://your-tenant.us.qlikcloud.com/api/v1/data-files" \
 -X POST \
 -H "Authorization: Bearer &amp;lt;API-key&amp;gt;" \
 -H "Content-type: multipart/form-data" \
 -F "Json={\"name\":\"MyFile.csv\",\"tempContentFileId\":\"theIdFromTempContsServiceYouGrabbedEarlier\"}"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll take a note to add examples to that page.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 15:59:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126705#M19288</guid>
      <dc:creator>Dave_Channon</dc:creator>
      <dc:date>2023-10-09T15:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Large data file upload using REST?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126784#M19290</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/1870"&gt;@Dave_Channon&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/141812"&gt;@jprdonnelly&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thanks for the information.&amp;nbsp; We will try it.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/226619"&gt;@yosuke-coupa&lt;/a&gt;&amp;nbsp;I've been meaning to add some examples to that doc. What language are you trying to use?&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We are using C#, but AFAIK, there is no C# SDK for Qlik.&amp;nbsp; Thus, we were looking for examples with cURL so that we can build it in C#.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2023 22:29:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2126784#M19290</guid>
      <dc:creator>yosuke-coupa</dc:creator>
      <dc:date>2023-10-09T22:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Large data file upload using REST?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2127147#M19294</link>
      <description>&lt;P&gt;Hi! It's possible to use this library for doing this through .NET:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.nuget.org/packages/QlikSenseRestClient/1.15.0" target="_blank"&gt;https://www.nuget.org/packages/QlikSenseRestClient/1.15.0&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I've experimented with this today, and I had to expose some additional endpoints to make it possible to do those "multipart/form-data" calls, so make sure you pick the latest version if you use it. I've also added an example that illustrates how to do it:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/kolsrud/qlik_rest_sdk/blob/master/Qlik.Sense.RestClient/Examples/QcsUploadDataFile/Program.cs" target="_blank"&gt;https://github.com/kolsrud/qlik_rest_sdk/blob/master/Qlik.Sense.RestClient/Examples/QcsUploadDataFile/Program.cs&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Oct 2023 15:33:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Large-data-file-upload-using-REST/m-p/2127147#M19294</guid>
      <dc:creator>Øystein_Kolsrud</dc:creator>
      <dc:date>2023-10-10T15:33:52Z</dc:date>
    </item>
  </channel>
</rss>

