Getting Dropbox - 403 error when logging on using dropboxuploader.php

为君一笑 提交于 2019-12-24 00:59:20

问题


Hey I'm using dropboxuploader.php to login into dropbox. All was working fine, but when i came into work yesterday i could no longer connect. This is what dropbox is returning to me.

HTTP/1.1 100 Continue

HTTP/1.1 403 Forbidden
Server: nginx/1.2.3
Date: Thu, 04 Oct 2012 08:44:36 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive

It seems you tried to do something we can't verify. Did you log into a different Dropbox account in a different window? Try clicking <a href="#" onclick="history.go(-1); return false;">here</a> to go back to the page you came from, or just go <a href="/home">home</a>.


回答1:


Replace the login function with below code and it should work:

protected function login() {
    $data = $this->request('https://www.dropbox.com/login');

    $str = '<input type="hidden" name="t" value="';
    $start = strpos($data,$str);

    $val = "";
    if($start !== false)
    {

        $val = substr($data,$start+strlen($str),24);
    }

    $data = $this->request('https://www.dropbox.com/login', true, array('login_email'=>$this->email, 'login_password'=>$this->password, 't'=>$val));

    if (stripos($data, 'location: /home') === false)
        throw new Exception('Login unsuccessful.');

    $this->loggedIn = true;
}



回答2:


Just update your dropbox uploader file instead doing your fixes.

https://github.com/jakajancar/DropboxUploader



来源:https://stackoverflow.com/questions/12743873/getting-dropbox-403-error-when-logging-on-using-dropboxuploader-php

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