Hi, I am using the http API to upload files into my account, however >50% of them fail and I suspect it is because I can have up to 20 parallel processes trying to upload in a window of about 5 seconds.
Error message:
{"error_summary": "too_many_write_operations/", "error": {"reason": {".tag": "too_many_write_operations"}}}
Is there a rate limit documented somewhere so I can ensure 100% upload? I understand there is a 1 million API calls/month limit which I won't even get remotely close to. We want to upload files in this manner maybe 2-4 times a month.
Here is the upload php code.
$accessToken = "xxxxxxxxxxxx";
$path = $_POST['fileName'];
$fp = fopen($path, 'rb');
$size = filesize($path);
$cheaders = array('Authorization: Bearer '. $accessToken,
'Content-Type: application/octet-stream',
'Dropbox-API-Arg: {"path":"/images/'.$path.'", "mode":"add"}');
$ch = curl_init('https://content.dropboxapi.com/2/files/upload');
curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_INFILE, $fp);
curl_setopt($ch, CURLOPT_INFILESIZE, $size);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
fclose($fp);