Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Use a Dropbox-sdk.min.js
<script src="http://bootboxjs.com/bootbox.js"></script> <script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script> dialog.modal('show'); var ACCESS_TOKEN = '<?php echo DROPBOX_ACCESS_TOKEN;?>'; var dbx = new Dropbox({ accessToken: ACCESS_TOKEN }); dbx.filesDownload({ path: "/" + id }) .then(function(data) { dialog.modal('hide'); if (data.fileBlob != null) { var downloadUrl = URL.createObjectURL(data.fileBlob); var downloadButton = document.createElement('a'); document.body.appendChild(downloadButton); downloadButton.setAttribute('href', downloadUrl); downloadButton.setAttribute('download', data.name); downloadButton.click(); window.URL.revokeObjectURL(downloadUrl); document.body.removeChild(downloadButton); } else { bootbox.alert({ message: "Error " + id + " dont exist." }); } }) .catch(function(data) { dialog.modal('hide'); bootbox.alert({ message: "Fail " + id + " wait" }); });
Is not running the cath.
Look:
POST https://content.dropboxapi.com/2/files/download 409 (path/not_found/.) f.end @ Dropbox-sdk.min.js:8 p @ Dropbox-sdk.min.js:8 D @ Dropbox-sdk.min.js:8 X @ Dropbox-sdk.min.js:8 i @ Dropbox-sdk.min.js:8 n.request @ Dropbox-sdk.min.js:8 r.filesDownload @ Dropbox-sdk.min.js:8 descargar @ factura:264 onclick @ factura:1 Dropbox-sdk.min.js:8 XHR finished loading: POST "https://content.dropboxapi.com/2/files/download". f.end @ Dropbox-sdk.min.js:8 p @ Dropbox-sdk.min.js:8 D @ Dropbox-sdk.min.js:8 X @ Dropbox-sdk.min.js:8 i @ Dropbox-sdk.min.js:8 n.request @ Dropbox-sdk.min.js:8 r.filesDownload @ Dropbox-sdk.min.js:8 descargar @ factura:264 onclick @ factura:1 Dropbox-sdk.min.js:8 Uncaught DOMException: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'blob'). at f.<anonymous> (https://unpkg.com/dropbox@2.5.0/dist/Dropbox-sdk.min.js:8:8015) at f.n.emit (https://unpkg.com/dropbox@2.5.0/dist/Dropbox-sdk.min.js:8:17283) at XMLHttpRequest.r.onreadystatechange (https://unpkg.com/dropbox@2.5.0/dist/Dropbox-sdk.min.js:8:12844) (anonymous) @ Dropbox-sdk.min.js:8 n.emit @ Dropbox-sdk.min.js:8 r.onreadystatechange @ Dropbox-sdk.min.js:8
Thanks! We'll look into it.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!