Answer the question
In order to leave comments, you need to log in
How to download a file from DropBox using PHP?
Hello, uploading to the cloud:
quire_once "lib/Dropbox/autoload.php";
use \Dropbox as dbx;
$accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; // Your Access token is
here $dbxClient = new dbx\Client($accessToken, "PHP-Example/1.0");
// allowed formats
if(isset($_FILES['upl']) && $_FILES['upl']['error'] == 0){
$fbuch=$_FILES['upl']['tmp_name'];
$f = fopen($fbuch, "r+");
$fbuch2="/".$_FILES['upl']['name'];
$fileMetadata = $dbxClient->uploadFile($fbuch2, dbx\WriteMode::add(), $f);
fclose($f);
}
How can I download a file? or get a link to it. I also heard about createShareableLink but this function also does not work
Answer the question
In order to leave comments, you need to log in
Tried with
$f = fopen("working-draft.txt", "w+b");
$fileMetadata = $dbxClient->getFile("/working-draft.txt", $f);
fclose($f);
print_r($fileMetadata); displays only an array of metadata, but I don’t know how to proceed further
Try Flysystem: flysystem.thephpleague.com/adapter/dropbox
Methods to work: flysystem.thephpleague.com/api
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question