You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

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!