We Want to Hear From You! What Do You Want to See on the Community? Tell us here!
Forum Discussion
kostas99
3 years agoNew member | Level 2
Issue with API returning no data when file name has some special character
I have a code written in php, where i am trying to fetch the file data with a apostrophe, when i am trying to do this it returns no result. Tried rawurlencode as well, but didnt work. Kindly help.
Code:
$file_path = "/posts/00 - jeff fader - together - (gents & dandy's - gents190).txt";
$file_content = wp_remote_retrieve_body( wp_remote_get( 'https://content.dropboxapi.com/2/files/download', array(
'headers' => array(
'Authorization' => 'Bearer ' . $api_key,
'Dropbox-API-Arg' => json_encode( array( 'path' => ($file_path) ) ),
),
)));
2 Replies
- Здравко3 years agoLegendary | Level 20
kostas99 wrote:..., when i am trying to do this it returns no result. ...
Hi kostas99,
There is always some result! 😉 It's either success or error description. It's another story if you just ignore the result when it's an error. Read it, there is some useful information that let you know what's wrong. By the way... the file name is OK. When you say 'no result', are you sure that the file is not empty? 🧐
Good luck.
PS: Most of the API calls (including download) use POST, not GET http method.
- Greg-DB3 years ago
Dropbox Community Moderator
kostas99 As Здравко said, if the Dropbox API call failed, the Dropbox API would reply with an error response. If the network connection itself failed, your network client should return an error indicating the issue. Please print out the API response or client error for more information. You may need to refer to your platform's documentation for information on how to access this.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,036 PostsLatest Activity: 2 days ago
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 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!