TijsVerkoyen\Dropbox\Dropbox::filesPost PHP Метод

filesPost() публичный Метод

Uploads a file.
public filesPost ( string $path, string $localFile, bool[optional] $overwrite = null, string[optional] $parentRev = null, $locale = null, bool[optional] $sandbox = false ) : array
$path string The path to the folder the file should be uploaded to. This parameter should not point to a file.
$localFile string The path to the local file.
$overwrite bool[optional]
$parentRev string[optional]
$sandbox bool[optional]
Результат array
    public function filesPost($path, $localFile, $overwrite = null, $parentRev = null, $locale = null, $sandbox = false)
    {
        // build url
        $url = '1/files/';
        $url .= $sandbox ? 'sandbox/' : 'dropbox/';
        $url .= str_replace(' ', '%20', trim((string) $path, '/'));
        $parameters = array();
        if ($overwrite !== null) {
            $parameters['overwrite'] = (bool) $overwrite ? 'true' : 'false';
        }
        if ($parentRev !== null) {
            $parameters['parent_rev'] = (string) $parentRev;
        }
        if ($locale !== null) {
            $parameters['locale'] = (string) $locale;
        }
        // make the call
        return $this->doCall($url, $parameters, 'POST', $localFile, true, true);
    }