<?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: Pdf file corrupt after downloding in Discuss Dropbox Developer &amp; API</title>
    <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Pdf-file-corrupt-after-downloding/m-p/374800#M811</link>
    <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/58569036/pdf-file-corrupt-after-downloding" target="_blank"&gt;https://stackoverflow.com/questions/58569036/pdf-file-corrupt-after-downloding&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;In case anyone else comes across this with the same question, it looks like they already found a solution and &lt;A href="https://stackoverflow.com/a/58579998/1305693" target="_self"&gt;posted it on StackOverflow here&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2019 15:12:40 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2019-10-28T15:12:40Z</dc:date>
    <item>
      <title>Pdf file corrupt after downloding</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Pdf-file-corrupt-after-downloding/m-p/374485#M808</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am using Sharetribe platform that I can't touch the server code but only get access on custom script. So I use jquery ajax to upload and download files to dropbox. The upload process went smooth but the download one has an issue that the downloaded file is corrupt. It can't be opened by any pdf software. I also found the size of the file bigger than the original pdf file in my dropbox. The original pdf file is good and can be opened perfectly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code to download the file&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var url = 'https://content.dropboxapi.com/2/files/download';

$.ajax({
    url: url,
    type: 'post',
    responseType: 'arraybuffer',
    headers: {
        "Authorization": "Bearer &amp;lt;TOKEN&amp;gt;",
        "Dropbox-API-Arg": JSON.stringify({"path": "/"+filename})
    },
    success: function (data){
        console.log(data);
        //CAN DOWNLOAD PDF BUT CAN'T OPEN IT. FILE PDF IS CORRUPT
        /*var blob = new Blob([data]);
        var aLink = document.createElement('a');
        aLink.href = window.URL.createObjectURL(blob);
        aLink.download = "file_tc.pdf";
        aLink.click();*/
        
        const url = window.URL.createObjectURL(new Blob([data], { type: 'application/pdf' }));
        window.open(url);
    },

    error: function (data){
        console.log(data);
    }
}) &lt;/PRE&gt;&lt;P&gt;Anyone can help what's wrong with the above code?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Oct 2019 07:49:04 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Pdf-file-corrupt-after-downloding/m-p/374485#M808</guid>
      <dc:creator>advcha</dc:creator>
      <dc:date>2019-10-26T07:49:04Z</dc:date>
    </item>
    <item>
      <title>Re: Pdf file corrupt after downloding</title>
      <link>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Pdf-file-corrupt-after-downloding/m-p/374800#M811</link>
      <description>&lt;P&gt;[Cross-linking for reference:&amp;nbsp;&lt;A href="https://stackoverflow.com/questions/58569036/pdf-file-corrupt-after-downloding" target="_blank"&gt;https://stackoverflow.com/questions/58569036/pdf-file-corrupt-after-downloding&lt;/A&gt;&amp;nbsp;]&lt;/P&gt;
&lt;P&gt;In case anyone else comes across this with the same question, it looks like they already found a solution and &lt;A href="https://stackoverflow.com/a/58579998/1305693" target="_self"&gt;posted it on StackOverflow here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 15:12:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Discuss-Dropbox-Developer-API/Pdf-file-corrupt-after-downloding/m-p/374800#M811</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2019-10-28T15:12:40Z</dc:date>
    </item>
  </channel>
</rss>

