<?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: Saving Data Directly from AJAX to Dropbox in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85684#M2615</link>
    <description>&lt;P&gt;THX Gregory, Android SDK would be a good solution. But i want to do an hybrid app with html5 an javascript, which "should" work on most mobile plattforms like android, wp8 and ios ... and acutally i am not so an insider in phonegap. But maybe i have to dive in phonegap ... Neverthelless thank you for the info.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2016 05:43:49 GMT</pubDate>
    <dc:creator>Werner S.6</dc:creator>
    <dc:date>2016-02-03T05:43:49Z</dc:date>
    <item>
      <title>Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85678#M2609</link>
      <description>&lt;P&gt;I'm trying to avoid having to create static files. I would like to submit data directly to Dropbox with AJAX. &lt;/P&gt;

&lt;P&gt;I tried one method of adding post data to the options to the url which returns the content. This doesn't work. I didn't expect it to work, but it did get far enough to time out while sending. Perhaps a problem with headers. &lt;/P&gt;

&lt;P&gt;The other method would be not sending a url but just supply a data stream of text but the drop-in API doesn't support this.&lt;/P&gt;

&lt;P&gt;&amp;lt;?php&lt;BR /&gt;
header('Content-Type: text/csv');&lt;BR /&gt;
header('Content-Disposition: attachment; filename="keywords.csv"');&lt;BR /&gt;
if (isset($_POST['csv'])) {&lt;BR /&gt;
    $csv = $_POST['csv'];&lt;BR /&gt;
    echo $csv;&lt;BR /&gt;
}&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;jQuery('#kwl-export-dropbox').click(function(e) {
    e.preventDefault();

    var kwl_url = jQuery('#kwl-url').val() + 'kwl-cvs.php';
    var results = jQuery('#kwl-results').val();
    var post_data = { cvs: results };

    var options = {
        data: post_data,
        type: 'POST',

        success: function () {
            console.log("Success! File saved to your Dropbox.");
        },

        progress: function(progress) {
            console.log("Progress: " + progress);
        },

        cancel: function() {
            console.log("Cancelled");
        },

        error: function(errorMessage) {
            console.log("Error: " + errorMessage);
            console.log("Data: " + results);
            console.log("URL: " + kwl_url);
        }
    };
    Dropbox.save(kwl_url, "keywords.csv", options); 
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:44:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85678#M2609</guid>
      <dc:creator>Keith G.9</dc:creator>
      <dc:date>2019-05-29T09:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85679#M2610</link>
      <description>&lt;P&gt;I have tried this as well. I get back "unauthorized". Not clear on the authorization process of using the API directly.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;jQuery('#kwl-export-dropbox').click(function(e) {
    e.preventDefault();

    var dropbox_url = 'https://api-content.dropbox.com/1/files_put/auto/keywords.csv';
    var results = jQuery('#kwl-results').val();

    jQuery.ajax({
        url: dropbox_url,
        data: results,
        type: 'PUT',
        dataType : 'text',

        success: function(text) {
            console.log("SUCCESS");
            console.log("status: " + text);
        },

        error: function(xhr, status, errorThrown) {
            console.log("ERROR");
            console.log("status: " + status);
            console.log("errorThrown: " + errorThrown);
        },

        complete: function(xhr, status) {
            console.log("COMPLETE");
            console.log("status: " + status);
        }
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 01 Mar 2015 05:10:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85679#M2610</guid>
      <dc:creator>Keith G.9</dc:creator>
      <dc:date>2015-03-01T05:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85680#M2611</link>
      <description>&lt;P&gt;Take a look at &lt;A href="https://blogs.dropbox.com/developers/2013/12/writing-a-file-with-the-dropbox-javascript-sdk/" rel="nofollow noreferrer"&gt;https://blogs.dropbox.com/developers/2013/12/writing-a-file-with-the-dropbox-javascript-sdk/&lt;/A&gt; and see if that helps. You'll need to use OAuth to authenticate the user. (The sample code in that blog post takes care of that.)&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2015 06:00:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85680#M2611</guid>
      <dc:creator>Steve M.</dc:creator>
      <dc:date>2015-03-01T06:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85681#M2612</link>
      <description>&lt;P&gt;Thank you. The unofficial Javascript SDK has better documentation and a "Hello World" example. I now see that the official Javascript SDK for the Datastore API would provide the same functionality. It beats writing a 3-stage AJAX query to create, upload, and delete a static temporary file.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2015 08:21:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85681#M2612</guid>
      <dc:creator>Keith G.9</dc:creator>
      <dc:date>2015-03-01T08:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85682#M2613</link>
      <description>&lt;P&gt;Works very well on Browser but how can i reach to get it work on android with the same lib:&amp;nbsp;dropbox-datastores-1.2.0.js&lt;/P&gt;
&lt;P&gt;Thx for advice&lt;/P&gt;</description>
      <pubDate>Mon, 01 Feb 2016 05:56:14 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85682#M2613</guid>
      <dc:creator>Werner S.6</dc:creator>
      <dc:date>2016-02-01T05:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85683#M2614</link>
      <description>&lt;P&gt;Werner, the .js library you mentioned was only built for JavaScript. (Also, note that the Datastore API &lt;A href="https://blogs.dropbox.com/developers/2015/04/deprecating-the-sync-and-datastore-apis/" target="_blank" rel="nofollow noreferrer"&gt;is deprecated&lt;/A&gt;.) For Android, you'd likely be better served by one of the Android/Java SDKs. For example for API v1 a.k.a. the Core API, there's an official SDK written in Java for Android&amp;nbsp;here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers-v1/core/sdks/android" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers-v1/core/sdks/android&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Or for API v2, there's a Java SDK that supports Android here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.dropbox.com/developers/documentation/java" rel="nofollow noreferrer"&gt;https://www.dropbox.com/developers/documentation/java&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;(Unless you mean you want it to work in the browser on Android, in which case the same JavaScript library should work like in any other supported browser.)&lt;/P&gt;
&lt;P&gt;If you have any specific questions, feel free to open a new thread with the specifics.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Feb 2016 02:12:37 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85683#M2614</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-02-02T02:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Saving Data Directly from AJAX to Dropbox</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85684#M2615</link>
      <description>&lt;P&gt;THX Gregory, Android SDK would be a good solution. But i want to do an hybrid app with html5 an javascript, which "should" work on most mobile plattforms like android, wp8 and ios ... and acutally i am not so an insider in phonegap. But maybe i have to dive in phonegap ... Neverthelless thank you for the info.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2016 05:43:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Saving-Data-Directly-from-AJAX-to-Dropbox/m-p/85684#M2615</guid>
      <dc:creator>Werner S.6</dc:creator>
      <dc:date>2016-02-03T05:43:49Z</dc:date>
    </item>
  </channel>
</rss>

