title: Can't download file from dropbox.com with Javascript?
body: <p>I have web application that can download from dropbox.com. The application is written using Javascript. I'm using the <code>dropbox.min.js</code> <a href="http://code.google.com/p/dropbox-js/" rel="nofollow">http://code.google.com/p/dropbox-js/</a> library running on a client. 
  This is a function of the library:</p>
  
  <pre><code>client.readFile(name, function(error, data) {
     if (error) {
        return showError(error);  // Something went wrong.
     }
     saveFile(name, data);
  });
  </code></pre>
  
  <p><code>saveFile(name, data)</code> is my function doing the following:</p>
  
  <pre><code>var saveFile = function(file, data)
  {
      var xmlhttp = getXmlHttp(); 
      xmlhttp.open('POST', 'saving.php', true); 
      xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); 
      xmlhttp.send("fileName=" + file + "&amp;data=" + data); 
  
  }
  
  function getXmlHttp(){
      var xmlhttp;
      try {
          xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
      } catch (e) {
          try {
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          } catch (E) {
              xmlhttp = false;
          }
      }
      if (!xmlhttp &amp;&amp; typeof XMLHttpRequest!='undefined') {
          xmlhttp = new XMLHttpRequest();
      }
      return xmlhttp;
  }
  </code></pre>
  
  <p>The problem is: while I'm trying to download assets (e.g. jpg doc, gif, etc.), I only receive 1kb instead of the full file. Are there any workarounds?  </p>