本文整理汇总了PHP中dropbox::putFile方法的典型用法代码示例。如果您正苦于以下问题:PHP dropbox::putFile方法的具体用法?PHP dropbox::putFile怎么用?PHP dropbox::putFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dropbox
的用法示例。
在下文中一共展示了dropbox::putFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _save
/**
* Create new file and write into it from file pointer.
* Return new file path or false on error.
*
* @param resource $fp file pointer
* @param string $dir target dir path
* @param string $name file name
* @param array $stat file stat (required by some virtual fs)
* @return bool|string
* @author Dmitry (dio) Levashov
**/
protected function _save($fp, $path, $name, $stat)
{
if ($name) {
$path .= '/' . $name;
}
$path = $this->_normpath($path);
try {
$this->dropbox->putFile($path, $fp);
} catch (Dropbox_Exception $e) {
return $this->setError('Dropbox error: ' . $e->getMessage());
}
$this->deltaCheck();
return $path;
}
示例2: _save
/**
* Create new file and write into it from file pointer.
* Return new file path or false on error.
*
* @param resource $fp file pointer
* @param string $path
* @param string $name file name
* @param array $stat file stat (required by some virtual fs)
* @return bool|string
* @internal param string $dir target dir path
* @author Dmitry (dio) Levashov
*/
protected function _save($fp, $path, $name, $stat)
{
if ($name) {
$path .= '/' . $name;
}
$path = $this->_normpath($path);
try {
$this->dropbox->putFile($path, $fp);
} catch (Dropbox_Exception $e) {
return $this->setError('Dropbox error: ' . $e->getMessage());
}
$this->deltaCheck();
if (is_array($stat)) {
$raw = $this->getDBdat($path);
if (isset($stat['width'])) {
$raw['width'] = $stat['width'];
}
if (isset($stat['height'])) {
$raw['height'] = $stat['height'];
}
$this->updateDBdat($path, $raw);
}
return $path;
}