Skip to content

Invalid Response #13

@DangerD256

Description

@DangerD256

Trying to download file:

<?php
include('../inc/vendor/autoload.php');
use Kunnu\Dropbox\Dropbox;
use Kunnu\Dropbox\DropboxApp;

$app = new DropboxApp(key, secret, access token generated in my apps);
$dropbox = new Dropbox($app);
$file = $dropbox->download("/Book1.xlsx");

//File Contents
echo $contents = $file->getContents();

And getting error:
PHP Fatal error: Uncaught exception 'Kunnu\Dropbox\Exceptions\DropboxClientException' with message 'Invalid Response'
...
/DropboxClient.php(163): Kunnu\Dropbox\DropboxResponse->__construct(Object(Kunnu\Dropbox\DropboxRequest), 'PK\x03\x04\x14\x00\x06\x00\x08\x00\x00\x00!\x00\xA7...', 200, Array)

How can i check what exact error i'm receving (maybe bad token or something else)?
Note: PK\x03\x04\ is the start if binary file, so script downloads file but some error occurs...

P.S. $dropbox->getMetadata("/Book1.xlsx"); works fine and receives info

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions