<?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 How to download file from picker without node.js? in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-download-file-from-picker-without-node-js/m-p/528061#M1957</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am wondering about how to download file from Dropbox chooser without node.js.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my JS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;options = {
    success: function(files) {
        // Download
        var filenames = files.map(x =&amp;gt; x.name);
        var fileids = files.map(x =&amp;gt; x.id);
        $.post("/API/dropbox-download", {Path: "3D_objects", Filenames: filenames, Fileids: fileids}, function(response) {
            console.log(response);
        });
    },
    cancel: function() {

    },
    linkType: "preview",
    multiselect: false,
    extensions: ['.stl'],
    folderselect: false,
    sizeLimit: 128000000
};

function UploadFilesFromDropbox_upload1()
{
    Dropbox.choose(options);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This script works good, but it only gives me a link to file, but I can't download it from code because download button must be pressed. I saw in documentation, that is possible to download file by id by http, so i wrote this code id PHP:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;    $curl = curl_init("https://content.dropboxapi.com/2/files/download");
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer &amp;lt;Access token&amp;gt;',
        'Dropbox-API-Arg: {"path": "id:&amp;lt;Id&amp;gt;"}',
        'Content-Type: text/plain'
    ));
    $response = curl_exec($curl);
    curl_close($curl);

    header("HTTP/1.1 200 OK");
    echo $response;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I get access token? There is Oauth for it, but Does I need to do Ouath before every chossing? I saw there is SDK on github, but it is installed through npm for node.js, is it possible to use SDK without node.js like google drive picker?&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 06:06:42 GMT</pubDate>
    <dc:creator>Vohry</dc:creator>
    <dc:date>2021-06-21T06:06:42Z</dc:date>
    <item>
      <title>How to download file from picker without node.js?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-download-file-from-picker-without-node-js/m-p/528061#M1957</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am wondering about how to download file from Dropbox chooser without node.js.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my JS:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;options = {
    success: function(files) {
        // Download
        var filenames = files.map(x =&amp;gt; x.name);
        var fileids = files.map(x =&amp;gt; x.id);
        $.post("/API/dropbox-download", {Path: "3D_objects", Filenames: filenames, Fileids: fileids}, function(response) {
            console.log(response);
        });
    },
    cancel: function() {

    },
    linkType: "preview",
    multiselect: false,
    extensions: ['.stl'],
    folderselect: false,
    sizeLimit: 128000000
};

function UploadFilesFromDropbox_upload1()
{
    Dropbox.choose(options);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This script works good, but it only gives me a link to file, but I can't download it from code because download button must be pressed. I saw in documentation, that is possible to download file by id by http, so i wrote this code id PHP:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;    $curl = curl_init("https://content.dropboxapi.com/2/files/download");
    curl_setopt($curl, CURLOPT_POST, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer &amp;lt;Access token&amp;gt;',
        'Dropbox-API-Arg: {"path": "id:&amp;lt;Id&amp;gt;"}',
        'Content-Type: text/plain'
    ));
    $response = curl_exec($curl);
    curl_close($curl);

    header("HTTP/1.1 200 OK");
    echo $response;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I get access token? There is Oauth for it, but Does I need to do Ouath before every chossing? I saw there is SDK on github, but it is installed through npm for node.js, is it possible to use SDK without node.js like google drive picker?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 06:06:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-download-file-from-picker-without-node-js/m-p/528061#M1957</guid>
      <dc:creator>Vohry</dc:creator>
      <dc:date>2021-06-21T06:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to download file from picker without node.js?</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-download-file-from-picker-without-node-js/m-p/528205#M1960</link>
      <description>&lt;P&gt;When using &lt;A href="https://www.dropbox.com/developers/chooser" target="_self"&gt;the Dropbox Chooser&lt;/A&gt;, it will return the link to each selected file in the "link" field of the returned object for each file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I see you're using "linkType" of "preview" here. If you just want to download the selected file data, you should use a "linkType" of "direct" instead. That will make the returned "link" a temporary direct link, which you can access directly to get the file data, without using the Dropbox API. That is, you can issue a standard HTTP GET request (either client-side in the browser, or server-side from your server) to retrieve the linked file data.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 15:19:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/How-to-download-file-from-picker-without-node-js/m-p/528205#M1960</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-06-21T15:19:28Z</dc:date>
    </item>
  </channel>
</rss>

