Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
jasskcet
7 years agoExplorer | Level 3
Eroor 400 when using the Dropbox choose API
Hi, I am trying to consume the Dropbox choose API as from the below link: https://www.dropbox.com/developers/chooser However, when the chooser window is shown, it ends up with error 400. ...
- 7 years ago
We do not currently include the MIME type in the response from metadata returned by the Chooser. I have filed this as a feature request for the Chooser.
In cases where the returned file name includes a file extension, is it possible to infer the MIME type from the file extension?
Greg-DB
Dropbox Community Moderator
7 years ago[Cross-linking for reference: https://stackoverflow.com/questions/52756880/error-400-while-using-dropbox-chooser-api?noredirect=1#comment92756867_52756880 ]
jasskcet No, app keys are not considered secret or sensitive, so it's acceptable (and necessary) to expose them to end-users. Use of your app key with the Dropbox Chooser/Saver is protected by the Chooser/Saver domain pre-registration requirement.
If you want to download the file content for the file selected in the Dropbox Chooser, you can do so by using the "direct" link type, and then downloading the content directly from the URL supplied in the "link" property returned in the response.
jasskcet
7 years agoExplorer | Level 3
Hi Greg,
Am able to see the link for download. The link will be something like this:
https://dl.dropboxusercontent.com/.....
However I need to read the content of this file as BLOB.
Is this possible using a http GET request or something?. Please let me know how to achieve this.
For instance: https://stackoverflow.com/questions/23684874/dropbox-chooser-get-content-of-the-file-in-javascript - outdated one though.
And when I checked this link https://www.dropboxforum.com/t5/API-Support-Feedback/Get-Access-Token-from-Chooser-API/td-p/269129, they have mentioned about GET, but am not able to do a successful get call using the link returned by chooser. ( Is it possible to simulate the GET in Chrome Postman? ). Also is there additional we need to pass for GET, for instance, access token or anything else?
- Greg-DB7 years ago
Dropbox Community Moderator
The Chooser doesn't offer a way to retrieve a blob, but you can download it directly using a GET request, as you mentioned and linked to.
Exactly how you do so is up to you, depending on what tools you have available. For example, you may want to use the jQuery get method, or just a XMLHttpRequest.
You don't need to supply anything extra to access the returned direct link.
- jasskcet7 years agoExplorer | Level 3
Greg, Thanks. I am able to successfully retrieve the data. However, when the file is selected, as a part of the metadata of the file that is returned(id, name, link etc), I would also need mime type of the document I selected. Is there a way to get this?. Kindly let me know.
Samad
- DBX_Robert7 years ago
Dropbox Staff
We do not currently include the MIME type in the response from metadata returned by the Chooser. I have filed this as a feature request for the Chooser.
In cases where the returned file name includes a file extension, is it possible to infer the MIME type from the file extension?
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
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!