A basic example of uploading a file to your Dropbox account using vanilla PHP and a generated access token.
To make this upload scripte work just follow these setps:
-
Login to your Dropbox account and go to the Dropbox developers portal.
-
Click on
App Console. -
Create a new app or use an existing app. Make sure the app has
files.content.writechecked in thePermissionstab. -
On the
Settingstab generate an Access Token. Place the Access Token in the.envfile. -
Test the upload script.
Note
The root folder ID must be kept current. If the upload is not working use the /get_authenticated_admin to retrieve an updated folder ID.
This cose sample uses a .env files as described on the php-env repo.