I've tried to download a file using Dropbox API & PHP with the following code:
$out_fp = fopen($local_tmp_file_path, 'w+');
$headers = array( 'Authorization: Bearer '. $DROPBOX_TOKEN,
'Content-Type:',
'Dropbox-API-Arg: '. json_encode(array(
"path"=> '/file_data/tmp/2021_07/191.png'
))
);
$ch = curl_init('https://content.dropboxapi.com/2/files/download');
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_FILE, $out_fp);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
fclose($out_fp);
The code run, and I always received a file the content like "Error Something went wrong. Don't worry, your files are still safe and the Dropboxers have been notified. Check out our Help Center and forums for help, or head back to home" !?!?!.
I've tried to download other files, but the problem still same.
I don't have trouble with upload file by the way.