Code Monkey home page Code Monkey logo

dropbox-v2-php's Issues

how use ListFolder?

I , my project have a folder named dropbox2 , inside ther's vendor installed with dropbox , under vendor i create a file list.php with this code

`<?php

use Alorel\Dropbox\Operation\Files\ListFolder\ListFolder;
use Alorel\Dropbox\Operation\Files\ListFolder\ListFolderContinue;
use Alorel\Dropbox\Options\Builder\ListFolderOptions;

function listFolder($folder, ListFolderOptions $options = null) {
    $res = json_decode((new ListFolder())->raw($folder, $options)->getBody()->getContents(), true);

    foreach ($res['entries'] as $i => $e) {
        yield $e['path_lower'] => $e;
        unset($res['entries'][$i]);
    }

    if ($res['has_more']) {
        $more = new ListFolderContinue();

        while ($res['has_more']) {
            $res = json_decode($more->raw($res['cursor'])->getBody()->getContents(), true);

            foreach ($res['entries'] as $i => $e) {
                yield $e['path_lower'] => $e;
                unset($res['entries'][$i]);
            }
        }
    }
}

listFolder('/dentaldropbox');`

but i dont see nothing

How to catch error or show status

in this document
https://www.dropbox.com/developers/documentation/http/documentation#files-save_url-check_job_status
by using curl we can have see error in command

curl -X POST https://api.dropboxapi.com/2/files/save_url \
    --header "Authorization: Bearer EXDuL6Bkvc4AAAAAAAABu-ZDfXZ0FRw87e00zjkrDbK2Rw_UpEGqlA-hz_tDgS3W" \
    --header "Content-Type: application/json" \
    --data "{\"path\": \"/a.jpg\",\"url\": \"https://igcdn-photos-e-a.akamaihd.net/hphotos-ak-xat1/t51.2885-15/e15/13398575_977722398990188_1841788166_n.jpg
\"}"

image
and now we see error in command
Error in call to API function "files/save_url": request body: could not decode input as JSON
and how to see in browser
I was set ini_set('display_errors', 1);

"HTTP ERROR 500"

Hi Arl,

I'll review my code i found out this line "(new Finish())->raw($data,$cursor,$commit);" causes an error "HTTP ERROR 500" during testing in linux live server. Can you help me?

Thanks,
Anuar

hi

Hi, can I use without composer?

Conflict Folder Already exists

Hello,

As said in the title I have an issue with your type of return when a folder is already existing, is there a way to "override" your Error Handler without touching your code or do i have to change it ?

Thank you in advance,

Fabricio

installation fails

Hello, I'm trying to install your dropbox api and get the following error. Any ideas?:

fuji:photos root# $PHP5 composer.phar require alorel/dropbox-v2-php
Using version ^0.3.3 for alorel/dropbox-v2-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)

  • Installing aloframework/common (1.3.3)
    Downloading: 100%
  • Installing psr/http-message (1.0.1)
    Downloading: 100%

Installation failed, reverting ./composer.json to its original content.

[ErrorException]
copy(/santa/home/Allegro/customers/Frantz/photos/vendor/composer/0b15cccd/php-fig-http-message-f6561bf/._CHANGELOG.
md): failed to open stream: No such file or directory

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] []...

fuji:photos root#

Authentication examples

Hi,

Thanks for the V2 API implementation!

I have checked examples provided, but I can't find the whole process that includes authentication (including getting the access token - with and without redirection to paste the token back into app asking for access). Am I missing something?

Milan

Invalid authorization value in HTTP header

Hi Art,

Can you help me this issue's?

Fatal error: Uncaught exception 'GuzzleHttp\Exception\ClientException' with message 'Client error: POST https://content.dropboxapi.com/2/files/upload resulted in a 400 Bad Request response: Error in call to API function "files/upload": Invalid authorization value in HTTP header "Authorization": "Bearer 163{" (truncated...) ' in C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113 Stack trace: #0 C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\guzzle\src\Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\promises\src\TaskQ in C:\xampp\htdocs\dropbox-v2-php\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php on line 113

About Preview section in RAW Example Code


Issue goes here
Looking at the RAW examples we have the GetPreview functionality where you have mentioned that

// Actually unsure about the content type; should be PDF

Does that mean that the preview works for the Documents only to be previewed as PDF files, and if i need to preview any other file like video, audio or image etc i would have to write my own script to preview those kinds of files by getting a temporary link for that file?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.