protected function upload($path, $contents, $opts = []) {
        $location = $this->applyPathPrefix($path);
        try {
            $tmpfile = tmpfile();
            fwrite($tmpfile, $contents);
            $localFile = $this->getStreamUri($tmpfile);

            $obj = $this->client->simpleUpload($localFile, $location, $opts);
            fclose($tmpfile);
            return $this->normalizeResponse($obj);
        } catch (DropboxClientException $e) {
            return false;
        }
    }