/** * 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; }
/** * 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; }