dropbox-php-sdk icon indicating copy to clipboard operation
dropbox-php-sdk copied to clipboard

Folder Can't Upload In Dropbox Server

Open rrpathi opened this issue 7 years ago • 0 comments

if (isset($_FILES["file"])) { // File to Upload $file = $_FILES['file'];

// File Path
$fileName = $file['name'];
$filePath = $file['tmp_name'];

try {
    // Create Dropbox File from Path
    $dropboxFile = new DropboxFile($filePath);

    // Upload the file to Dropbox
    $uploadedFile = $dropbox->upload($dropboxFile, "/" . $fileName, ['autorename' => true]);

    // File Uploaded
    echo $uploadedFile->getPathDisplay();
} catch (DropboxClientException $e) {
    echo $e->getMessage();
}

}

rrpathi avatar Sep 27 '18 11:09 rrpathi