Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
I've been using the PHP SDK to save files programmatically for well over a year without issue. However, just in the past few days a problem suddenly appeared that is throwing a fatal error. I have updated the SDK with the current dropbox-sdk-php-1.1.6 files, with no change.
The error occurs as I make a call to
$dbxClient->createShareableLink($objFile->fileFolder);
PHP Fatal error: Uncaught exception 'Dropbox\Exception_BadResponseCode' with message 'Unexpected HTTP status 301
' in /~application~/includes/dropbox-sdk/Dropbox/RequestUtil.php:256
Stack trace:
#0 /~application~/includes/dropbox-sdk/Dropbox/Client.php(1034): Dropbox\RequestUtil::unexpectedStatus(Object(Dropbox\HttpResponse))
#1 /~application~/uploadFile.php(124): Dropbox\Client->createShareableLink('//WGASC/Alvarad...')
#2 {main}
thrown in /~application~/includes/dropbox-sdk/Dropbox/RequestUtil.php on line 256
Again - this has been working just fine for months until the last few days (<1 week).
Anyone have an idea of what's going on ... and how to resolve?
Thank you in-advance.
-john
You mentioned uploadFileFromString, but it looks like the error is coming from createShareableLink?
Also, I notice that the path you're passing to createShareableLink has an extra leading slash. My guess is that this is the culprit... try getting rid of that leading slash to see if the problem goes away.
NOTE: I removed the additional '/' from the beginning of the folder name and the problem was resolved. What is strange is that the double '/' has been working for months.
My guess is that something changed on the Dropbox side to redirect paths with double slashes in them. (E.g. /foo//bar gets redirect to /foo/bar.) I'll make sure the right folks take a look at this.
This created a huge problem with our integration and we were scratching our head what is wrong. Finally landed here and now know the issue. Is there a way for drop box to inform the community when something of this sort changes? Lot of time gets wasted otherwise
Apologies for the inconvenience Pankaj! We of course never want to break apps, and we email and post on the blog whenever we are planning a breaking change or deprecation. This change in validation wasn't intended to be a breaking change though, so there wasn't any outreach.
For reference, we've now reverted the behavior change, so the double slash version should work again. We do recommend only using a single slash though.
Hi there!
If you need more help you can view your support options (expected response time for a 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!