dimanche 24 juillet 2016

Laravel Dropbox File Upload: InvalidArgumentException in Client.php line 1473:

i want to upload file with dropbox Api, for that i have used flysystem-dropbox package.

My route:

Route::get('/dropbox-upload-file',[
    'uses'=>'FileController@dropboxFileUpload',
    'as'=> 'dropbox-upload-file'
    ]);

Controller Code:

  public function dropboxFileUpload()
    {
        $Client = new Client(config('filesystems.dropbox.key'), config('filesystems.dropbox.secret'));
        $file = fopen(public_path('images/angular_crud.png'), 'rb');
        $size = filesize(public_path('images/angular_crud.png'));
        $dropboxFileName = '/dropboxfile-name.png';
        $Client->uploadFile($dropboxFileName,WriteMode::add(),$file, $size);
    }

So while I tried to access the Route I got the following Error:

InvalidArgumentException in Client.php line 1473:
'accessToken' invalid: can't be null

If anyone face the problem before or got the solution, please help me to solve it.Thanks in Advance.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ap6XsS
via IFTTT

1 commentaire:

  1. 401 Bad or expired token. This can happen if the user or Dropbox revoked or expired an access token. To fix, you should re-authenticate the user.
    follow this link to Read about standard api errors.
    https://www.dropbox.com/developers-v1/core/docs

    RépondreSupprimer