Dropbox API and PHP

自作多情 提交于 2020-01-13 06:47:28

问题


I am gelling following error while trying to read file content which is residing in a subfolder rather than a parent folder.

Fatal error: Uncaught exception 'Exception' with message 'Invalid signature. Expected signature base string: GET&https%3A%2F%2Fapi-content.dropbox.com%2F1%2Ffiles%2Fdropbox%2FProjects%2FMAC%2520Error.rtf&oauth_consumer_key%3Dbdagb07uu6zq827%26oauth_nonce%3D46d063d5815a0972d63cf72359c0349f%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1324449973%26oauth_token%3D7f2cr9kppqo2hxz%26oauth_version%3D1.0 (Status Code: 403)' in /Applications/MAMP/htdocs/dbcatalog/BenTheDesigner-Dropbox-88e3876/Dropbox/OAuth/Consumer/Curl.php:133 Stack trace: #0 /Applications/MAMP/htdocs/dbcatalog/BenTheDesigner-Dropbox-88e3876/Dropbox/API.php(109): Dropbox\OAuth\Consumer\Curl->fetch('GET', 'https://api-con...', 'files/dropbox/P...', Array) #1 /Applications/MAMP/htdocs/dbcatalog/BenTheDesigner-Dropbox-88e3876/check.php(21): Dropbox\API->getFile('Projects/MAC Er...') #2 {main} thrown in /Applications/MAMP/htdocs/dbcatalog/BenTheDesigner-Dropbox-88e3876/Dropbox/OAuth/Consumer/Curl.php on line 133

I am using Ben's Dropbox Library for php

https://github.com/BenTheDesigner/Dropbox

Thanks


回答1:


If you are looking for a simple PHP-API you can find one here:

https://github.com/hawaiianchimp/Dropbox-PHP-API/




回答2:


This is the message thats returned when a OAuth request is signed incorrectly. This is likely the fault of the library you're using. At first glance, it looks like it may be encoding the name of your "MAC Error.rtf" file incorrectly. Checkout the PHP SDK dropbox mentions on its website as an alternative and raise this issue with the library's owner.

The code that generates this would help too.



来源:https://stackoverflow.com/questions/8585862/dropbox-api-and-php

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!