Пример #1
0
	public function postsave()
	{
		if ($this->_value instanceof IFileUpload && $this->_value->error() == UPLOAD_ERR_OK)
		{
			$dataM = CoOrg::getDataManager($this->_dataPath);
			if ($this->_oldValue)
			{
				$file = $dataM->get($this->_oldValue);
				if ($file) $file->delete();
			}
			$this->_value->store();
		}
		parent::postsave();
	}