alorel / dropbox-v2-php Goto Github PK
View Code? Open in Web Editor NEWA PHP SDK for Dropbox's v2 API
License: Apache License 2.0
A PHP SDK for Dropbox's v2 API
License: Apache License 2.0
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
I tried many times to understand examples code but i am not understanding and not able to use them.So provide me a simple example to use Dropbox and upload data in my web application.
Thanks in advance.
Issue goes here
I'd like to take this project over.
It can be use? i download and blank show!
Please help me setup and use it!
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
\"}"
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);
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, can I use without composer?
Hello @Alorel,
I'm interested to take over this repository as a maintainer. Please knock me at [email protected] if you need any other things to discuss.
Thanks.
Hi,
I have public dropbox directory that have folder photos, photos folder have folders with numeric names 193112910, 193112911, 193112912, etc.
(public>photos>193112XXX)
I need to get dropbox link for numeric folders. For example i pass 193112910 parameter, and want to get dropbox link for this folder. For example https://www.dropbox.com/sh/XXXXy0v3xbry7yd/AABeBvWMaqXXXXcQAEVhSQza?dl=0
Can i do that using your SDK?
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
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)
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#
Hey Alorel,
I was going through the following example :
dropbox-v2-php > examples > Raw > Files > Upload.md
https://github.com/immu/dropbox-v2-php/blob/master/examples/Raw/Files/Upload.md
I wanted to understand, how to authorize a user if I already have access token, secret key. I didn't find document to this
I'm sorry for the 'bug' label, the correct label should be 'Question'
Thanks & Regards,
Imran
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
We use a tool called Stone to automatically generate large portions of our Dropbox SDKs from these specs. It would be great if this library could use Stone as well, which has an upfront cost, but really reduces maintenance burden. See the Dropbox Python SDK for an example.
Thanks for making this SDK by the way!
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
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.