You are here

private function BackupMigrateDropboxAPI::_file_upload_upload in Backup and Migrate Dropbox 7.3

Same name and namespace in other branches
  1. 7 backup_migrate_dropbox.dropbox_api.inc \BackupMigrateDropboxAPI::_file_upload_upload()
  2. 7.2 backup_migrate_dropbox.dropbox_api.inc \BackupMigrateDropboxAPI::_file_upload_upload()

Uploads the $contents of a file (with 1 request) to the indicated $path.

@link https://www.dropbox.com/developers/documentation/http/documentation#file... Dropbox API /upload

Parameters

string $path:

string $content:

Return value

object The json decoded response.

Throws

RuntimeException

1 call to BackupMigrateDropboxAPI::_file_upload_upload()
BackupMigrateDropboxAPI::file_upload in ./backup_migrate_dropbox.dropbox_api.inc
Uploads a file to the given path.

File

./backup_migrate_dropbox.dropbox_api.inc, line 482

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

private function _file_upload_upload($path, $content) {

  // Simple upload.
  $parameters = [
    'path' => $path,
    'mode' => 'add',
    'autorename' => TRUE,
    'mute' => FALSE,
  ];
  return $this
    ->send_message('content', 'files/upload', $parameters, $content);
}