Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement