We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.

Forum Discussion

RockwoodON's avatar
RockwoodON
New member | Level 2
2 months ago

CURL access has recently stopped working

I have been accessing dropbox files using CURL with an access token via the follwing url:
 
 
Recently CURL calls are timing out with 0 bytes returned. The formt of my call is as shown below. Has something changed that would cause this to fail? And ideas?
 
Thanks,
Chris
 
 
CODE (PHP):
-----------------------------------------------------------------------------------------
 
$header_array = array(
'Authorization: Bearer ' . $accessToken,
'Content-Type:',
'Dropbox-API-Arg: {"path":"' . $fileid . '"}'
);
 
$ch = curl_init();
 
curl_setopt($ch, CURLOPT_CAINFO, "cacert.pem");
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header_array);
curl_setopt($ch, CURLOPT_FILE, $out_fp);
 
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); 
curl_setopt($ch, CURLOPT_TIMEOUT, 20); //timeout in seconds
 
$output = curl_exec($ch);
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Can you enable verbose mode (that should be "CURLOPT_VERBOSE") and share the full output so we can take a look? Be sure to redact the access token though. Thanks!

    • RockwoodON's avatar
      RockwoodON
      New member | Level 2

      Thanks for your quick reply. I enabled the VERBOSE option, but did not get a response. The CURL error is:

      "Operation timed out after 20001 milliseconds with 0 bytes received"

      On a more positive note, I can confirm that posting/uploading a file to Dropbox is working, so it is something about the download process.

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Is that the entirety of the output you get from curl? There should be more output in verbose mode. For example, when I try this code with verbose mode, I get a bunch of output starting with "* Trying"... which then shows the IP address of the server it connected to, and so on. Can you share the rest of that? It should be useful context for debugging this. Please be sure to redact the access token though. Thanks!

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,877 PostsLatest Activity: 12 months ago
326 Following

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!