dropbox-api | A minimal implementation of Dropbox API v2 | REST library
kandi X-RAY | dropbox-api Summary
kandi X-RAY | dropbox-api Summary
This is a minimal PHP implementation of the Dropbox API v2. It contains only the methods needed for our flysystem-dropbox adapter. We are open however to PRs that add extra methods to the client.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Upload a chunk .
- Upload a file .
- Get request headers .
- Send a request to Dropbox API endpoint .
- Requests API endpoint .
- Get the token .
dropbox-api Key Features
dropbox-api Examples and Code Snippets
Community Discussions
Trending Discussions on dropbox-api
QUESTION
I have a form that accepts a file to pass on to Dropbox using the session upload. I've wrapped the code in a Fastify server but always end up with an error in append:
...ANSWER
Answered 2021-Nov-21 at 18:26Ok figured it out. Basically in my example I am terminating the session on end
but it turns out the end
event is fired at the same time as the last data
event so I am effectively closing the session in the midst of the last chunk append. I refactored things to have a flag isEnd
that gets set in the end
event handler and moved the terminate session and resolve code inside of the data
handler to be fired from there once isEnd
is set.
QUESTION
Header field in Postman:
...ANSWER
Answered 2021-Nov-06 at 04:27Try selecting the text in Postman and right clicking, then select EncodeURIComponent in the context menu
QUESTION
I'm trying to create an Automator app that would work like this:
- You would drag any type of image file onto the app.
- The app would make a duplicate of the file, convert it to JPEG, scale it down to 500px, remove the " copy" part at the end of the filename.
- Upload the original file to a specific folder on my Dropbox account.
- When step 3 is done, upload the converted JPEG to another specific folder on my Dropbox account.
- Delete the converted JPEG locally when the process is finished.
Steps 1 and 2 are working. I've also found a shell script that can be used to upload files to Dropbox with a provided access token. So I can make it upload the converted JPEG, as that seems to be what the $1
variable is holding in the script.
Here's the shell script:
...ANSWER
Answered 2021-Oct-14 at 20:32I think with the Set Value of Variable and Get Value of Variable actions you can achieve what you're trying to do here.
This workflow provides an example of using these. You can set multiple different named variables, and then read and reuse them later. To get this workflow to work properly I had to select Ignore this action's input
for the Get step, otherwise it used both the value of example
(which was the filename of the file dropped onto the app) and also the output of Ask for confirmation (which was the filename again, so it tried to move the same file to the Trash twice).
When creating a variable you just choose New Variable...
from the drop-down menu. You then give it a name, and leave the Value box empty (and it gets set from the Set... action's input).
Once you have a Variable set up you can also drag it into some places (from the Variable section at the bottom of the window), as I've done here to make the file path show up in the Ask for Confirmation action. You can also remove any unused variables by right-clicking on the variable in the Variable section, and choosing Delete exampleVariable
Full steps which I think would complete your full workflow could be:
- Set Value of Variable first, to store your 'original filename' in variable
original
(or something), then the parts of the workflow you already have: - Duplicate file
- Convert to to JPEG
- Scale
- Remove "copy"
- Set Value of Variable
converted
to input - Your already-working upload shell script step
- Get Value of Variable to read
converted
back in (this should haveIgnore this action's input
ticked) - Move Finder Items to Trash to remove the JPEG file (could be a shell script to delete the file immediately)
- Get Value of Variable to read
original
back in (this should also haveIgnore this action's input
ticked) - Your upload shell script step again (to upload this time the original file)
- Display happy alert message
QUESTION
I'm trying to fetch a file from Dropbox using PHP and save it on my server, but not with succes so far. This is what I came up with:
...ANSWER
Answered 2021-Aug-30 at 15:31If I plug in a valid access token and path to the code you shared, and inspect the content of the downloaded file, I see it is:
Error in call to API function "files/download": Bad HTTP "Content-Type" header: "application/x-www-form-urlencoded". Expecting one of "text/plain", "text/plain; charset=utf-8", "application/octet-stream", "application/octet-stream; charset=utf-8".
You can fix that by setting the 'Content-Type' header accordingly in your $headers
.
Also, note that the path
you supply in Dropbox-API-Arg
should start with a /
.
(And for reference, you should check the status code to see if the call failed or not.)
QUESTION
I have a VBA function in Excel which creates a document.docx and then uploads it to Dropbox. It is successfully creating a file in Dropbox, but it can't be opened because it is only 2 bytes in size. Why is there no content in this file? I don't really know how files actually work, it it something to do with the script converting the content to bytes?
...ANSWER
Answered 2021-Jul-07 at 21:53Try setting the correct Content-length
value:
QUESTION
In Refresh token is not returned from Dropbox API when using grant_type=refresh_token
The poster asks why he's not getting a new refresh token when using the new dropbox v2 api.
The answer is that it's not needed. Refresh tokens don't expire from dropbox unless revoked.
Is that still the case? I'm reading in https://developers.dropbox.com/oauth-guide
That "When using refresh tokens, your call to the /oauth2/token endpoint with the grant_type of authorization_code will return a new short-lived access token and a new refresh token, which should be securely stored."
But I'm still not seeing a refresh token when I use one to get an access token.
...ANSWER
Answered 2021-Apr-29 at 15:10The Dropbox API /oauth2/token endpoint does not return a new refresh token during the refresh process, nor are there plans to make it do so. The official documentation for the Dropbox /oauth2/token endpoint can be found here.
The Dropbox OAuth Guide is referring to when you call /oauth2/token for grant_type=authorization_code
, i.e., when first exchanging the authorization code for a short-lived token and (optional) refresh token. (Apologies the "new" there is misleading. We'll fix that up.)
When you call /oauth2/token for grant_type=refresh_token
, i.e., when using a refresh token to get a new short-lived access token, it will not return another refresh token.
QUESTION
I have a WebApp that stores a backup in the cloud of the user. I use the third party libary: http://fabi.me/en/php-projects/dropphp-dropbox-api-client/
Login works. But im stuck at the point where I can download it.
The following code downloads the file on the cloud and writes it to a file.
...ANSWER
Answered 2021-Jan-11 at 10:22Out of the box, you can't.
However, the DownloadFile
method is quite simple:
https://github.com/f4bsch/DropPHP/blob/master/DropboxClient.php#L261
My suggestion is to override this method by creating your own, CustomDropboxClient
by extending the used DropboxClient
library, then rewrite the file handling logic. It's using the curl library. By setting the CURLOPT_RETURNTRANSFER
option, you can retrieve the data without writing it to a file.
This should give you enough hints to start this project. If you need anything, just comment.
QUESTION
I have a simple script to upload the file to dropbox whenever it changes. I wanted to run it at system startup and keep it in a background to let the script watch the file.
I've created a plist, however it runs the script and exits with code 0.
plist
...ANSWER
Answered 2021-Jan-03 at 09:22Edit crontab file with crontab -e
and add the following to that file:
QUESTION
Using php 7.2
...ANSWER
Answered 2020-Dec-17 at 14:30This seems to be a problem with the virtual box filesystem. I created an issue to composer and hopefully more insight will be gained.
https://github.com/composer/package-versions-deprecated/issues/21
QUESTION
I am trying to write csv files with fwrite/fputcsv in a loop but when I use those functions, they write in the first file and then the tab loads infinitely and doesn't do anything else.
I know those functions are the problem because when I remove them the rest of the code runs properly.
Here's my code :
...ANSWER
Answered 2020-Oct-26 at 14:48I would suggest you to split the task in two sections. First write the files in your server using fopen
in w
mode. After writings, use another loop for reading the files using fopen
in r
mode for using in your cURL to upload in the server. Using the same handler for writing and uploading might cause the lagging problem.
You can use curl_multi_init for handling multiple cURL requests asynchronously. Here is also a post on it.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install dropbox-api
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page